Doc tweaks.
[p5sagit/p5-mst-13.2.git] / lib / encoding.t
CommitLineData
9f4817db 1print "1..5\n";
0a378802 2
3use encoding "latin1"; # ignored (overwritten by the next line)
f14ed3c6 4use encoding "greek"; # iso 8859-7 (no "latin" alias, surprise...)
0a378802 5
0a378802 6# "greek" is "ISO 8859-7", and \xDF in ISO 8859-7 is
f14ed3c6 7# \x{3AF} in Unicode (GREEK SMALL LETTER IOTA WITH TONOS),
0a378802 8# instead of \xDF in Unicode (LATIN SMALL LETTER SHARP S)
9
9f4817db 10$a = "\xDF";
11$b = "\x{100}";
12
13print "not " unless ord($a) == 0x3af;
0a378802 14print "ok 1\n";
15
9f4817db 16print "not " unless ord($b) == 0x100;
0a378802 17print "ok 2\n";
18
9f4817db 19my $c;
20
21$c = $a . $b;
22
23print "not " unless ord($c) == 0x3af;
0a378802 24print "ok 3\n";
25
9f4817db 26print "not " unless length($c) == 2;
27print "ok 4\n";
28
29print "not " unless ord(substr($c, 1, 1)) == 0x100;
30print "ok 5\n";
0a378802 31