- or download this
open my $fh, ">:raw:encoding(UTF-16LE):crlf:utf8", "ok.utf16" or die;
print $fh "h\x{00e4}llo\n";
$ od -tx1 -An ok.utf16
68 00 e4 00 6c 00 6c 00 6f 00 0d 00 0a 00
- or download this
open my $fh, ">:raw:encoding(UTF-16LE):crlf", "err.utf16" or die;
print $fh "h\x{00e4}llo\n";
...
68 00 00 00 6c 00 6c 00 6f 00 0d 00 0a 00
^^
wrong
- or download this
Malformed UTF-8 character (unexpected non-continuation byte 0x6c,
immediately after start byte 0xe4) in null operation at ...