Hi,<br><br>When a page loaded in firefox,&nbsp; then it will send a ajax request to get data in json format.<br><br>Some gb2312 words is in the json data.<br><br>When catalyst is started by /home/robin/CBS/script/cbs<div id="1esd" class="ArwC7c ckChnd">
_server.pl,
the data got by client is same as the data i print on the screen by
$c-&gt;log-&gt;debug(). It&#39;s showed corrected in firefox client or ie
client.<br>
<br>But when catalyst is running by apache mod_perl, the data got by
client is different from the data i print on the screen by
$c-&gt;log-&gt;debug().It&#39;s showed incorrected.<br><br>A chinese world in gb2312 charset have 2 bytes.&nbsp; what I found in the client is that:<br>
<br>2 bytes of a chinese word was splited, and a octal byte \303 or \302 was added before every byte. So showed incorrect in client.<br><br>Anyone meet the same problem when using mod_perl?<br><br><div>I use standard JSON module [use JSON;] from cpan,version is 2.07. code like below:<br>
&nbsp;&nbsp;&nbsp; my $json = new JSON;<br>&nbsp;&nbsp;&nbsp; $json-&gt;canonical(1);<br>&nbsp;&nbsp;&nbsp; my $response = $json-&gt;encode($var);<br><br>But i think the problem is nothing to do with JSON,&nbsp; for some points like below:<br>
1. The problem will not occur when I use catalyst&#39;s built-in server<br>2. After JSON module convert a hash to JSON data, I use $c-&gt;log-&gt;debug&nbsp; output to screen, I saw it was correct.<br><br>I think the problem occur when apache (mod_perl) send data to client. the data was modified. But I don&#39;t kown why?<br>

Some code like below:<br>&nbsp;&nbsp;&nbsp; my $jsResponse = $ajaxRequest-&gt;{response} . &quot;\n$callback_function&quot;;<br>&nbsp;&nbsp;&nbsp; $c-&gt;log-&gt;debug(&quot;JS Response:\n$jsResponse&quot;); # the showed on the screen is correct;<br>

&nbsp;&nbsp;&nbsp; $c-&gt;response-&gt;content_type(&#39;text/html; charset=GB2312&#39;);<br>&nbsp;&nbsp;&nbsp; $c-&gt;response-&gt;body($jsResponse);<br><br>The mod_perl,apache,perl version like below:<br>[Mon
Jun 02 12:28:31 2008] [notice] Apache/2.0.55 (Unix) PHP/5.2.3
mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations<br>
</div><br>
Any other solution?<br><br>Thanks!<br><br>Robincui<br>
</div>