develooper Front page | perl.perl6.users | Postings from May 2020

slurp with enc("utf16") doesn't work

Joseph Brenner
May 13, 2020 20:58
slurp with enc("utf16") doesn't work
Message ID:
I just got to look into this one again a little further, and it does seem that
reading a utf16 file like this doesn't work:

      my $contents = slurp( $file, :enc("utf16") );

Though this, however, does work:

      my $fh = $ :r, :enc("utf16") );
      my $contents = $fh.slurp;

Also the routine form (as opposed to the method form) of slurp works
with other encodings like utf8 and latin1.

So I'm opening an issue for this on github: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About