Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] utf form problems




So my script is setting the charset right for it's output.
And the index.html that my server sends is in just
text/html.   Marty Pauley showed me how to test the
encode/decode and it looks like the input to the script is
ok.  But something isn't right because I'm getting mojibake
back from the script.  It feels like I'm closer.

Sounds like perl might be treating your string as bytes rather than a unicode string,
then muching them on output.

You should read the docs on the Encode module;
perldoc Encode

You may need to do
$string = decode("utf8", param("stuff"));
to tell perl the %E5%8A%A9 bytes from the form is actually utf8 string

also look at the docs on the -C option to the perl command (or the PERL_UNICODE environment variable)
perldoc perlrun

and finally this has more background on utf8/unicode support in perl
perldoc perlunicode




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links