perl-unicode

Re: encoding(UTF16-LE) on Windows

2011-01-20 21:40:35

Jan Dubois wrote:
Files opened on Windows already have the :crlf layer pushed by default,
so you somehow need to get the :encoding layer*below*  it.

Is it possible to re-write the working statement

      open(my $fh, ">:raw:encoding(UTF-16LE):crlf", $filename) or die $!;

in a way that works correctly on any platform (without referring to $^O) ?

Bob