8 BEGIN { require "./test.pl"; require "./charset_tools.pl"; }
12 # It is important that the script contains at least one newline character
13 # that can be expanded to \r\n on DOSish systems.
14 fresh_perl_is(byte_utf8a_to_utf8n("\xEF\xBB\xBF") . "print 1;\nprint 2", "12", {}, "script starts with a BOM" );
16 # Big- and little-endian UTF-16
18 my $encoding = $end ? 'UTF-16LE' : 'UTF-16BE';
19 my $prog = join '', map chr($_), map {
20 $end ? @$_[0, 1] : @$_[1, 0]
23 [ 0xFE, 0xFF ], map [ 0, utf8::native_to_unicode(ord($_)) ],
24 split //, "print 1;\nprint 2"
26 fresh_perl_is($prog, "12", {}, "BOM indicates $encoding");