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

Combining UTF-16 output with :crlf is awkward

Thread Next
From:
Jan Dubois
Date:
March 28, 2006 12:08
Subject:
Combining UTF-16 output with :crlf is awkward
Message ID:
029b01c652a3$4ad70430$6062a8c0@candy
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, or if PerlIO_isutf8()
should walk the layer stack?

Cheers,
-Jan



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