open $dst,">$dst_enc" or die "$dst_utf : $!";
binmode($dst);
- binmode($dst, ":bytes"); # in case LC_ALL is UTF8ish
+ if (PerlIO::Layer->find('perlio')) {
+ binmode($dst, ":bytes"); # in case LC_ALL is UTF8ish
+ }
print $dst $txt;
close($dst);
is(compare_text($src_enc, $dst_enc), 0 => "$dst_enc eq $src_enc")
my $jisx0212 = File::Spec->catfile(dirname(__FILE__), 'jisx0212.utf');
open my $fh, $jisx0208 or die "$jisx0208: $!";
-binmode($fh, ":bytes");
+if (PerlIO::Layer->find('perlio')) {
+ binmode($fh, ":bytes"); # in case LC_ALL is UTF8ish
+}
$utf8off = join('' => <$fh>);
close $fh;
$utf8on = decode('utf8', $utf8off);
for my $name (keys %CJKT){
open my $fh, $CJKT{$name} or die "$CJKT{$name}: $!";
- binmode($fh, ":bytes");
+ if (PerlIO::Layer->find('perlio')) {
+ binmode($fh, ":bytes"); # in case LC_ALL is UTF8ish
+ }
$utf8off = join('' => <$fh>);
close $fh;