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
From:
Eric Brine
Date:
May 16, 2010 14:46
Subject:
Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32
Message ID:
AANLkTimxV8Y5bwKg4rx0Y936RlTFxbJERZ-ETFhVNkQQ@mail.gmail.com
On Sun, May 16, 2010 at 9:21 AM, David Golden <xdaveg@gmail.com> wrote:

> Strangely:
>
> C:\david\tmp>perl -MPerlIO -wE "binmode STDOUT; say for
> PerlIO::get_layers(STDOUT)"
> unix
> crlf
>
> 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.
>
>
That causes isssues if you try to add :encoding(UTF-16):crlf to a handle
that previously had :crlf since the layer ordering ends up wrong.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About