Re: [mp1] binmode(STDOUT, ':utf8') fails silently
[prev]
[thread]
[next]
[Date index for 2005/05/05]
Brian Dimeler wrote:
> Ha, nevermind, I figured it out. Turns out that when a param was sent to
> the script indicating a cookie should be changed, it was using CGI's
> header() function to generate the header rather than my header text.
> Adding -charset => 'UTF-8' to header() did the trick, naturally.
>
> Still curious about binmode(), though; is there some mod_perl-specific
> reason that it would fail?
Under mod_perl 1.x, binmode() is just a stub that does nothing. Should
probably be fixed to return true.
It's under mod_perl 2.x where things get really interesting. There you have
tied IO or PerlIO, and actually need to call binmode(). And calling it just
before the first print() doesn't seem always enough either, I had to move it
rather close to the script start.