5 print "1..0 # encoding pragma does not support EBCDIC platforms\n";
9 use encoding "latin1"; # ignored (overwritten by the next line)
10 use encoding "greek"; # iso 8859-7 (no "latin" alias, surprise...)
12 # "greek" is "ISO 8859-7", and \xDF in ISO 8859-7 is
13 # \x{3AF} in Unicode (GREEK SMALL LETTER IOTA WITH TONOS),
14 # instead of \xDF in Unicode (LATIN SMALL LETTER SHARP S)
19 print "not " unless ord($a) == 0x3af;
22 print "not " unless ord($b) == 0x100;
29 print "not " unless ord($c) == 0x3af;
32 print "not " unless length($c) == 2;
35 print "not " unless ord(substr($c, 1, 1)) == 0x100;
38 print "not " unless ord(chr(0xdf)) == 0x3af; # spooky
41 print "not " unless ord(pack("C", 0xdf)) == 0x3af;
44 # we didn't break pack/unpack, I hope
46 print "not " unless unpack("C", pack("C", 0xdf)) == 0xdf;
49 # the first octet of UTF-8 encoded 0x3af
50 print "not " unless unpack("C", chr(0xdf)) == 0xce;
53 print "not " unless unpack("U", pack("U", 0xdf)) == 0xdf;
56 print "not " unless unpack("U", chr(0xdf)) == 0x3af;
59 # charnames must still work
60 use charnames ':full';
61 print "not " unless ord("\N{LATIN SMALL LETTER SHARP S}") == 0xdf;
66 $c = "\xDF\N{LATIN SMALL LETTER SHARP S}" . chr(0xdf);
68 print "not " unless ord($c) == 0x3af;
71 print "not " unless ord(substr($c, 1, 1)) == 0xdf;
74 print "not " unless ord(substr($c, 2, 1)) == 0x3af;
79 print "not " unless "\xDF" =~ /\x{3AF}/;
82 print "not " unless "\x{3AF}" =~ /\xDF/;
85 print "not " unless "\xDF" =~ /\xDF/;
88 print "not " unless "\x{3AF}" =~ /\x{3AF}/;