Forum Moderators: open

Message Too Old, No Replies

serving readable content in mandarin

request for advice on serving mandarin characters

         

s1developer

2:12 pm on Aug 15, 2005 (gmt 0)

10+ Year Member



Hello,
I'm trying to serve content in Chinese from my Perl script (specifically a mod_perl Apache content handler). Currently I'm outputting a header which contains a character set attribute of gb2312, and also the Content-Type meta tag in the HTML says that it's gb2312 content. I've received reports that in China the Chinese characters are not readable, even though they display ok for me (in the UK).

I'm wondering if there's something I need to do at the Perl level to make this work, for example perhaps something with the Encode module to encode/decode the HTML into GB2312 within Perl before sending it on to the browser.

If anyone has any advice or has solved a similar problem then I would be very grateful for the help.

My current code does the equivalent of the following, in case it's helpful in figuring out what the problem is:

#----------
use CGI 'header';

my $html =
q[<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
]; # etc etc, including chinese characters

print header(-charset=>'gb2312'), $html;
#----------

Many thanks.

s1developer

tntpower

4:14 pm on Aug 15, 2005 (gmt 0)

10+ Year Member



Try use Encode::CN