http://qs321.pair.com?node_id=79356

Lexicon has asked for the wisdom of the Perl Monks concerning the following question:

I am trying desperatly to enable reliable Japanese support into my Perlscript. Do any of you have experience with getting perl to play nicely with a 2-Byte character set under PerlScript in IIS? Currently, IIS does nothing short of completely freak out. Consider this code:

<%@ LANGUAGE = PerlScript %> <html><body> <% use locale; $Response->Write("English<p>"); # English $Response->Write("日本語<p>" ); # Japanese (In Japanese) %> </body></html>

Most of you will see what Perl probably see...a bunch of line noise. I can leave the code alone, hit refresh, and Perl/IIS will generate different error values on different reloads. Usually it's a simple Syntax Error or </code>Cannot find string terminator '"'</code> but sometimes it will:

PerlScript Error Error:'80004005' (in cleanup) Unrecognized character \xBC example.asp, at Line 6

and sometimes, just for spite, it will work. ;-)

Perl and IIS are fine. If I take out the Japanese, I've no problems. Actually, if I put the Japanese inside of <%= 日本語 %> it seems to work fine, but that is kind of limiting when I need to send e-mail. I've tried embedding the Japanese in HEREDOC, qq() and others. No luck. I'm tempted to try to start parsing it out of a file, but one can imagine how ugly that might become.

Thus I ask: I know PerlScript doesn't really support Japanese yet, but is there any reliable way I can force it to do so anyway?

NT Server 4.0 Service Pack 6 & IIS
ActiveState 5.6.0 Build 623 (5.6.1 636 is out. I might try that tomorrow)

-Lexicon