From: Jarkko Hietaniemi Date: Sun, 27 Jan 2002 16:32:32 +0000 (+0000) Subject: ASCIIisms. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=07229bbd38a40809e9122ae72c3fd635b9fe18eb;p=p5sagit%2Fp5-mst-13.2.git ASCIIisms. p4raw-id: //depot/perl@14444 --- diff --git a/ext/PerlIO/t/encoding.t b/ext/PerlIO/t/encoding.t index eb523ca..a8550d5 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 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 eq "\xb4\x58\xb4\x59\xb4\x62"; + } else { + # alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3) + print "not " unless 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 {