Re: [mp1] binmode(STDOUT, ':utf8') fails silently

[prev] [thread] [next] [Date index for 2005/05/05]

From: Markus Wichitill
Subject: Re: [mp1] binmode(STDOUT, ':utf8') fails silently
Date: 19:19 on 05 May 2005
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.

[mp1] binmode(STDOUT, ':utf8') fails silently
Brian Dimeler 18:15 on 05 May 2005

Re: [mp1] binmode(STDOUT, ':utf8') fails silently
Brian Dimeler 19:02 on 05 May 2005

Re: [mp1] binmode(STDOUT, ':utf8') fails silently
Markus Wichitill 19:19 on 05 May 2005

Generated at 06:56 on 17 May 2005 by mariachi v0.52