5 print "1..0 # encoding pragma does not support EBCDIC platforms\n";
10 use encoding "latin1"; # ignored (overwritten by the next line)
11 use encoding "greek"; # iso 8859-7 (no "latin" alias, surprise...)
13 # "greek" is "ISO 8859-7", and \xDF in ISO 8859-7 is
14 # \x{3AF} in Unicode (GREEK SMALL LETTER IOTA WITH TONOS),
15 # instead of \xDF in Unicode (LATIN SMALL LETTER SHARP S)
20 print "not " unless ord($a) == 0x3af;
23 print "not " unless ord($b) == 0x100;
30 print "not " unless ord($c) == 0x3af;
33 print "not " unless length($c) == 2;
36 print "not " unless ord(substr($c, 1, 1)) == 0x100;
39 print "not " unless ord(chr(0xdf)) == 0x3af; # spooky
42 print "not " unless ord(pack("C", 0xdf)) == 0x3af;
45 # we didn't break pack/unpack, I hope
47 print "not " unless unpack("C", pack("C", 0xdf)) == 0xdf;
50 # the first octet of UTF-8 encoded 0x3af
51 print "not " unless unpack("C", chr(0xdf)) == 0xce;
54 print "not " unless unpack("U", pack("U", 0xdf)) == 0xdf;
57 print "not " unless unpack("U", chr(0xdf)) == 0x3af;
60 # charnames must still work
61 use charnames ':full';
62 print "not " unless ord("\N{LATIN SMALL LETTER SHARP S}") == 0xdf;
67 $c = "\xDF\N{LATIN SMALL LETTER SHARP S}" . chr(0xdf);
69 print "not " unless ord($c) == 0x3af;
72 print "not " unless ord(substr($c, 1, 1)) == 0xdf;
75 print "not " unless ord(substr($c, 2, 1)) == 0x3af;
80 print "not " unless "\xDF" =~ /\x{3AF}/;
83 print "not " unless "\x{3AF}" =~ /\xDF/;
86 print "not " unless "\xDF" =~ /\xDF/;
89 print "not " unless "\x{3AF}" =~ /\x{3AF}/;