it worked. How strange...
I found it strange too. I just clued in what the error is.
First of all,
binmode STDOUT, ':utf-8';
is a no-op, since there's no "utf-8" layer.
>perl -le"print binmode(STDERR, ':utf8')?1:0" 1 >perl -le"print binmode(STDERR, ':utf-8')?1:0" 0 >perl -le"print binmode(STDERR, ':encoding(utf8)')?1:0" 1 >perl -le"print binmode(STDERR, ':encoding(utf-8)')?1:0" 1
If we do it properly (:encoding(utf-8)) we end up with your orignal problem.
Your problem is that you are double-encoding! You're telling CGI to encode your data using UTF8 (-charset => 'utf-8') and then you encode it again using binmode STDOUT, ":utf8";.
The solution is to get rid of binmode completely and only use CGI's methods to output.
In reply to Re^3: CGI hidden params vs. character encoding
by ikegami
in thread CGI hidden params vs. character encoding
by graff
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |