3 my @good = split /\n/, <<AMEN ;
4 09 0d 0a 0c # allowed control
5 33 31 34 31 35 39 32 3d 70 69 # ASCII
6 73 74 c5 99 c3 ad 7a 6c c3 ad 6b 0a # Czech
9 e0 a0 80 # first 3-byte
10 ef bf bd # last valid 3-byte
11 f0 90 80 80 # first 4-byte
12 f3 af bf bd # last non-private
15 my @bad = split /\n/, <<AMEN ;
22 c1 bf # too small 2-byte
24 e0 9f bf # too small 3-byte
25 ef bf be # non-character
26 ef bf bf # non-character
27 f0 8f bf bf # too small 4-byte
28 ee 80 80 # private plane 0
29 ef a3 bf # private plane 0
30 f3 bf bf bd # private plane F
31 f4 8f bf bd # private plane 10
32 f4 8f bf be # non-character
33 f4 8f bf bf # non-character
34 ed a4 91 # high surrogate
35 ed b0 91 # low surrogate
39 my ($in, $outcome) = @_;
40 my ($hex, $cmt) = ($in =~ m{^(.*?)\s+#\s+(.*)$}) or die;
43 $raw =~ s{([0-9a-fA-F]{2})}{chr hex $1}ge;
44 print "$hex ($cmt): ";
45 open my $p, '|-', './utf8-check' or die;
50 $outcome or die "Wrong answer\n";
52 !$outcome or die "OK, but should fail\n";
57 test($_, 0) for @good;