From: Jarkko Hietaniemi Date: Mon, 10 Jun 2002 12:21:39 +0000 (+0000) Subject: #17150 didn't expect -Uuseperlio. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6eb996d2d10f7a08ecac148836d901658386ee17;p=p5sagit%2Fp5-mst-13.2.git #17150 didn't expect -Uuseperlio. p4raw-id: //depot/perl@17161 --- diff --git a/ext/Encode/t/CJKT.t b/ext/Encode/t/CJKT.t index 412d01e..411511e 100644 --- a/ext/Encode/t/CJKT.t +++ b/ext/Encode/t/CJKT.t @@ -99,7 +99,9 @@ for my $charset (sort keys %Charset) { 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") diff --git a/ext/Encode/t/guess.t b/ext/Encode/t/guess.t index fc71275..667537a 100644 --- a/ext/Encode/t/guess.t +++ b/ext/Encode/t/guess.t @@ -48,7 +48,9 @@ my $jisx0208 = File::Spec->catfile(dirname(__FILE__), 'jisx0208.utf'); 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); @@ -78,7 +80,9 @@ Encode::Guess->set_suspects(keys %CJKT); 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;