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:
Leon Timmermans
Date:
May 16, 2010 07:12
Subject:
Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32
Message ID:
AANLkTin-L8HNnUPs6ag3z0emcBR-PWsVFWmuXuh7B5Fl@mail.gmail.com
On Sun, May 16, 2010 at 3:21 PM, 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.
>

Yeah, I've also been bitten by this confusing behavior. Unfortunately,
those flags aren't available from Perl, only XS (unless I've missed
something). I've been planning to write a module to query filehandles
for such properties. It would be nice if the core exposed those flags,
it feels like a better place to me.

Leon

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