This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
#17150 didn't expect -Uuseperlio.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 10 Jun 2002 12:21:39 +0000 (12:21 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 10 Jun 2002 12:21:39 +0000 (12:21 +0000)
p4raw-id: //depot/perl@17161

ext/Encode/t/CJKT.t
ext/Encode/t/guess.t

index 412d01e..411511e 100644 (file)
@@ -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")
index fc71275..667537a 100644 (file)
@@ -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;