diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-27 22:48:39 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-27 22:48:39 +0000 |
commit | 2b18b92ae9cb89a30a11cc76419a41bbb69e54c2 (patch) | |
tree | 06c1cdbe0737dc8ff2df55e40f835243437fbe1e /ext/PerlIO | |
parent | a4089e06d5f9246f1e2f6612598055a38385f226 (diff) | |
download | perl-2b18b92ae9cb89a30a11cc76419a41bbb69e54c2.tar.gz |
binmode(FH, ":bytes") is the right way, methinks.
p4raw-id: //depot/perl@15559
Diffstat (limited to 'ext/PerlIO')
-rw-r--r-- | ext/PerlIO/t/encoding.t | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t index bba6628419..133388c00e 100644 --- a/ext/PerlIO/t/encoding.t +++ b/ext/PerlIO/t/encoding.t @@ -16,7 +16,8 @@ my $utf = "utf$$"; my $fail1 = "fail$$"; my $russki = "koi8r$$"; -if (open(GRK, ">:raw", $grk)) { +if (open(GRK, ">$grk")) { + binmode(GRK, ":bytes"); # alpha beta gamma in ISO 8859-7 print GRK "\xe1\xe2\xe3"; close GRK or die "Could not close: $!"; @@ -34,7 +35,8 @@ if (open(GRK, ">:raw", $grk)) { close($i); } -if (open(UTF, "<:raw", $utf)) { +if (open(UTF, "<$utf")) { + binmode(UTF, ":bytes"); if (ord('A') == 193) { # EBCDIC # alpha beta gamma in UTF-EBCDIC Unicode (0x3b1 0x3b2 0x3b3) print "not " unless <UTF> eq "\xb4\x58\xb4\x59\xb4\x62"; @@ -58,7 +60,8 @@ if (open(UTF, "<:raw", $utf)) { close($i); } -if (open(GRK, "<:raw", $grk)) { +if (open(GRK, "<$grk")) { + binmode(GRK, ":bytes"); print "not " unless <GRK> eq "\xe1\xe2\xe3"; print "ok 8\n"; close GRK; |