1BEGIN { 2 if ($ENV{'PERL_CORE'}) { 3 chdir 't'; 4 unshift @INC, '../lib'; 5 } 6 require Config; import Config; 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 27ok open my $fh, ">:encoding(cp1250)", do{\(my $str)}; 28ok print $fh ("a" x 1023) . "\x{0378}"; 29ok close $fh; 30