First of all, decode( 'utf8', $untrusted ) is a security issue.
Wouldn't that depend on what you do with the value that you get back from decode()? Also, what would be the remedy? I would expect it's okay to do something like eval { decode( 'UTF-8', $untrusted, Encode::FB_CROAK ) } and check $@, or maybe just pass the return value from decode() through a regex or other test for valid content.
Secondly, UTF8 is a perl-specific encoding. UTF-8 is the actual encoding.I haven't pinpointed the problem, but changing UTF8 to UTF-8 throughout fixed the problem.
Okay... I had to try twice -- I didn't get all the "utf8" strings changed over to "UTF-8" on the first try, but after I fixed the one I had forgotten ("binmode STDOUT..."), it worked. How strange...
Thanks!!!
In reply to Re^2: CGI hidden params vs. character encoding
by graff
in thread CGI hidden params vs. character encoding
by graff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |