Subject: | problem with layers |
# IO::File passes, File::Slurp test fails.
use Test::More;
use File::Slurp qw(read_file);
use IO::File qw();
require File::BOM;
{
my $greeting = read_file 'hi.utf16', {binmode => ':via(File::BOM)'};
is $greeting, "\x{ff28}\x{ff45}\x{ff4c}\x{ff4c}\x{ff4f}\x{3000}\x
{ff35}\x{ff52}\x{ff49}";
}
{
open my $fh, '<:via(File::BOM)', 'hi.utf16';
my $greeting = join q(), $fh->getlines;
is $greeting, "\x{ff28}\x{ff45}\x{ff4c}\x{ff4c}\x{ff4f}\x{3000}\x
{ff35}\x{ff52}\x{ff49}";
}
done_testing;
__END__
$ hex hi.utf16
0000 ff fe 28 ff 45 ff 4c ff 4c ff 4f ff 00 30 35 ff ..(.E.L.
L.O..05.
0010 52 ff 49 ff R.I.