1BEGIN { 2 if ($ENV{'PERL_CORE'}) { 3 chdir 't'; 4 unshift @INC, '../lib'; 5 } 6 require Config; Config->import(); 7 if ($Config{'extensions'} !~ /\bEncode\b/) { 8 print "1..0 # Skip: Encode was not built\n"; 9 exit 0; 10 } 11 if (ord("A") == 193) { 12 print "1..0 # Skip: EBCDIC\n"; 13 exit 0; 14 } 15 $| = 1; 16} 17 18use strict; 19use warnings; 20 21use Encode; 22use PerlIO::encoding; 23$PerlIO::encoding::fallback &= ~Encode::WARN_ON_ERR; 24 25use Test::More tests => 3; 26 27my @t = qw/230 13 90 65 34 239 86 15 8 26 181 25 305 123 22 139 111 6 3 28100 37 1 20 1 166 1 300 19 1 42 153 81 106 114 67 1 32 34/; 29my $str; 30ok open OUT, '>:encoding(iso-8859-1)', \$str; 31my $string = join "\x{fffd}", map { '.'x$_ } @t; 32ok print OUT $string; 33ok close OUT; 34