Skip to content

Commit

Permalink
XXX PerlIO-encoding/t/encoding.t: Generalize for non-ASCII platform
Browse files Browse the repository at this point in the history
Probably has to wait for Encode to work
  • Loading branch information
khwilliamson committed Nov 27, 2014
1 parent d8b5ae2 commit 11adfe3
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ext/PerlIO-encoding/t/encoding.t
Expand Up @@ -9,6 +9,7 @@ BEGIN {
print "1..0 # Skip: not Encode\n";
exit 0;
}
require "../../t/charset_tools.pl";
}

use Test::More tests => 24;
Expand Down Expand Up @@ -37,13 +38,9 @@ if (open(GRK, ">$grk")) {

if (open(UTF, "<$utf")) {
binmode(UTF, ":bytes");
if (ord('A') == 193) { # EBCDIC
# alpha beta gamma in UTF-EBCDIC Unicode (0x3b1 0x3b2 0x3b3)
is(scalar <UTF>, "\xb4\x58\xb4\x59\xb4\x62");
} else {
# alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3)
is(scalar <UTF>, "\xce\xb1\xce\xb2\xce\xb3");
}

# alpha beta gamma in UTF-8 Unicode (0x3b1 0x3b2 0x3b3)
is(scalar <UTF>, byte_utf8a_to_utf8n("\xce\xb1\xce\xb2\xce\xb3"));
close UTF;
}

Expand Down

0 comments on commit 11adfe3

Please sign in to comment.