6 unless (find PerlIO::Layer 'perlio') {
7 print "1..0 # Skip: not perlio\n";
16 my $BOM = chr(0xFEFF);
19 my ($enc, $tag, $bom) = @_;
20 open(UTF_PL, ">:raw:encoding($enc)", "utf.pl")
21 or die "utf.pl($enc,$tag,$bom): $!";
22 print UTF_PL $BOM if $bom;
23 print UTF_PL "$tag\n";
25 my $got = do "./utf.pl";
29 test("utf16le", 123, 1);
30 test("utf16le", 1234, 1);
31 test("utf16le", 12345, 1);
32 test("utf16be", 123, 1);
33 test("utf16be", 1234, 1);
34 test("utf16be", 12345, 1);
36 test("utf8", 1234, 1);
37 test("utf8", 12345, 1);
39 test("utf16le", 123, 0);
40 test("utf16le", 1234, 0);
41 test("utf16le", 12345, 0);
42 test("utf16be", 123, 0);
43 test("utf16be", 1234, 0);
44 test("utf16be", 12345, 0);
47 1 while unlink "utf.pl";