1 # Copyright 2000-2004 Double Precision, Inc.
2 # See COPYING for distribution information.
5 # Generate unicode upper/lower/titlecase translations.
8 ** Copyright 2000-2004 Double Precision, Inc.
9 ** See COPYING for distribution information.
19 open (U
, "UnicodeData.txt") || die "$!\n";
25 my @fields= split /;/;
27 my ($code, $uc, $lc, $tc);
61 grep ($bucket[ $_ % $tabsize ] .= "$_\n", keys %FLAG);
65 for ($i=0; $i < $tabsize; $i++)
69 grep ( ++$cnt, split (/\n/, $bucket[$i]));
71 $maxcnt=$cnt if $cnt > $maxcnt;
74 print "const unsigned unicode_case_hash=$tabsize;\n";
75 print "/* unicode_case_maxbucket="
76 . ($maxcnt+2) . "*/\n";
78 print "const unicode_char unicode_case_tab[][4]={\n";
82 for ($i=0; $i<$tabsize; $i++)
98 printf("{0x%04x,0x%04x,0x%04x,0x%04x},",$j,$u,$l,$t);
99 print "\n" if ($idx % 4) == 3;
102 } split(/\n/, $bucket[$i]);
106 const unsigned unicode_case_offset[$tabsize]={
109 for ($i=0; $i<$tabsize;$i++)
111 printf("%4d", $offset[$i]);
112 print "," if $i < $tabsize-1;
114 print "\n" if ($i % 16) == 15;