7 print "Usage: $0 <cldr dir> <input file>\n";
11 open(FIN, "$ARGV[0]/posix/UTF-8.cm");
17 foreach my $line (@lines) {
18 next if ($line =~ /^#/);
19 next if ($line eq "");
20 next if ($line !~ /^</);
22 my @a = split(" ", $line);
27 $cm{$a[1]} = $a[0] if (!defined $cm{$a[1]});
35 foreach my $line (@lines) {
41 my @l = split(//, $line);
42 for (my $i = 0; $i <= $#l; $i++) {
43 my $hex = sprintf("%X", ord($l[$i]));
45 if (( $l[$i] gt "\x20")
46 && ($l[$i] lt "a" || $l[$i] gt "z")
47 && ($l[$i] lt "A" || $l[$i] gt "Z")
48 && ($l[$i] lt "0" || $l[$i] gt "9")
49 && ($l[$i] lt "\x80")) {
54 if (defined $cm{$hex}) {
59 $hex = sprintf("%X%X", ord($l[$i]), ord($l[$i + 1]));
60 if (defined $cm{$hex}) {
66 $hex = sprintf("%X%X%X",
67 ord($l[$i]), ord($l[$i + 1]), ord($l[$i + 2 ]));
68 if (defined $cm{$hex}) {