cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kane <k...@freebsd-uk.eu.org>
Subject Re: Cocoon-1.8's charset encoding problems
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi,all:

I have solved this problem, need to set encoding at two places,
<?xml version="1.0" encoding="gb2312"?> , 
response.setContentType("text/html;charset=gb2312");
as following:
=============================================================================
<?xml version="1.0" encoding="gb2312"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="test.xsl" type="text/xsl"?>

<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
  <page title="Time of Day">
  
    <xsp:logic>
      // Define a variable to hold the time of day
      response.setContentType("text/html;charset=gb2312");
      Date now = new Date();
    </xsp:logic>
  
    <p>
      To the best of my knowledge, it's now中文
      <!-- Substitute time of day here -->
      <xsp:expr>now</xsp:expr>
      中文
    </p>
  </page>
</xsp:page>
================================================================



2000-10-20 15:24:00 :
>Hi,all:
>
>   We are using Cocoon-1.8 with Tomcat-4.0 to implement XML tranlation to 
>HTML, and there are many Chinese characters(GB2312), but cocoon can't process
>them correctly, all Chinese characters become "??" chars. Could you give me
>some advices on how to correct it? I have tried to set 
><?xml version="1.0" encoding="GB2312"?>, and it can't work too.
>
>Thanks a lot.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
            Kane
            kane@freebsd-uk.eu.org


Mime
View raw message