diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-27 16:32:32 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-27 16:32:32 +0000 |
commit | 07229bbd38a40809e9122ae72c3fd635b9fe18eb (patch) | |
tree | 965f3993a07f312b79493c690474e99c8fd012b7 /ext/PerlIO/t | |
parent | 644d52eb61163033f4d40e8304200b279eda94fc (diff) | |
download | perl-07229bbd38a40809e9122ae72c3fd635b9fe18eb.tar.gz |
ASCIIisms.
p4raw-id: //depot/perl@14444
Diffstat (limited to 'ext/PerlIO/t')
-rw-r--r-- | ext/PerlIO/t/encoding.t | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t index eb523ca80d..a8550d57af 100644 --- a/ext/PerlIO/t/encoding.t +++ b/ext/PerlIO/t/encoding.t @@ -35,8 +35,13 @@ if (open(GRK, ">$grk")) { } if (open(UTF, "<$utf")) { - # alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3) - print "not " unless <UTF> eq "\xce\xb1\xce\xb2\xce\xb3"; + 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"; + } else { + # alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3) + print "not " unless <UTF> eq "\xce\xb1\xce\xb2\xce\xb3"; + } print "ok 4\n"; close UTF; } @@ -86,11 +91,14 @@ if (open(RUSSKI, ">$russki")) { my $buf2; read(RUSSKI, $buf2, 1); my $offset = tell(RUSSKI); - if (ord($buf1) == 0x3c && ord($buf2) == 0x3f && $offset == 2) { + if (ord($buf1) == 0x3c && + ord($buf2) == (ord('A') == 193) ? 0x6f : 0x3f && + $offset == 2) { print "ok 11\n"; } else { - printf "not ok 11 # %#x %#x %d\n", - ord($buf1), ord($buf2), $offset; + printf "not ok 11 # [%s] [%s] %d\n", + join(" ", unpack("H*", $buf1)), + join(" ", unpack("H*", $buf2)), $offset; } close(RUSSKI); } else { |