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

Combining UTF-16 output with :crlf is awkward

Thread Next
Jan Dubois
March 28, 2006 12:08
Combining UTF-16 output with :crlf is awkward
Message ID:
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?


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