Re: Using slurp to read in a utf16 file

2020-04-26 Thread Joseph Brenner
To expand on the point a bit, doing exactly the same spurt/slurp works with "utf8", but doing it with "utf16" fails to read the text back in: { my $unichar_str =# ሀⶀ䷼ꪪⲤⲎ "\x[1200]\x[2D80]\x[4DFC]\x[]\x[2CA4]\x[2C8E]"; my $file = "/tmp/stuff_in_utf8.txt"; my $fh = $file.

Using slurp to read in a utf16 file

2020-04-26 Thread Joseph Brenner
Looking at the documentation for slurp, it looks as though there's a convenient "enc" option you can use if you're not reading utf8 files. So I thought this would work: my $contents = slurp $file, enc => "utf16"; It's not doing what I expected... Raku acts like there's nothing in $contents. H