develooper Front page | perl.perl5.porters | Postings from September 2006

Re: Combining UTF-16 output with :crlf is awkward

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
September 21, 2006 07:53
Subject:
Re: Combining UTF-16 output with :crlf is awkward
Message ID:
20060921165306.058ef61a@grubert.mandriva.com
Jan Dubois wrote:
> On Wed, 29 Mar 2006, Nick Ing-Simmons wrote:
> > Jan Dubois <jand@ActiveState.com> writes:
> > >I just noticed (in a mailing list posting by someone else) that adding
> > >the :crlf layer after a Unicode layer turns back on the "Wide character
> > >in print" warnings.  You can get rid of them by turning the PERLIO_F_UTF8
> > >bit on the :crlf layer on too:
> > >
> > >  open my $fh, ">:raw:encoding(UTF-16LE):crlf:utf8", $filename or die;
> > >  print $fh "\x{feff}";
> > >
> > >But this isn't very intuitive. I wonder if either PerlIOCrlf_pushed()
> > >should "inherit" the flag from the lower layer,
> > 
> > That would be my preference I think.
> 
> Does the attached patch look right to you?
> 
> > Perhaps that should be the default behaviour for a layer?
> 
> Probably, except for the :encoding, :raw and :utf8 layers. Any other
> exceptions?
> 
> If you think the patch below is the right way to do it, then I can
> try to add it to all the other PerlIOXxxx_pushed() functions too.
> Or is there anything else that needs to be done?
> 
> Cheers,
> -Jan
> 
> --- perlio.c.orig	Wed Apr 05 07:47:13 2006
> +++ perlio.c	Thu Apr 06 18:06:24 2006

Thanks, applied as change #28879.

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