develooper Front page | perl.perl5.porters | Postings from May 2010

Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32

Thread Previous | Thread Next
David Golden
May 16, 2010 06:21
Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32
Message ID:
On Fri, May 14, 2010 at 7:55 PM, Tatsuhiko Miyagawa
<> wrote:
> The following test fails on win32 systems on perl 5.8.9, 5.10.1 and
> 5.12.0, whereas it passes fine on other systems like Linux or Mac OS
> X. It looks like binmode $t, ":raw" doesn't have any effect of taking
> away ":utf8". Per my discussion with jdb at #p5p, i'm filing a bug
> report.

There is an easier workaround:

    binmode($t, ":bytes")

Using that instead of ":raw" will do what you want and cause your tests to pass.


C:\david\tmp>perl -MPerlIO -wE "binmode STDOUT; say for

But further investigation with get_layers() and detail => 1 reveals
that crlf just has different flags set depending on whether binmode
(raw) is called on STDOUT or not.

-- David

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About