1 # Copyright 2000-2004 Double Precision, Inc.
2 # See COPYING for distribution information.
4 # $Id: mkultcase.pl,v 1.3 2004/02/01 06:09:09 mrsam Exp $
6 # Generate unicode upper/lower/titlecase translations.
9 ** Copyright 2000-2004 Double Precision, Inc.
10 ** See COPYING for distribution information.
12 ** $Id: mkultcase.pl,v 1.3 2004/02/01 06:09:09 mrsam Exp $
21 open (U
, "UnicodeData.txt") || die "$!\n";
27 my @fields= split /;/;
29 my ($code, $uc, $lc, $tc);
63 grep ($bucket[ $_ % $tabsize ] .= "$_\n", keys %FLAG);
67 for ($i=0; $i < $tabsize; $i++)
71 grep ( ++$cnt, split (/\n/, $bucket[$i]));
73 $maxcnt=$cnt if $cnt > $maxcnt;
76 print "const unsigned unicode_case_hash=$tabsize;\n";
77 print "/* unicode_case_maxbucket="
78 . ($maxcnt+2) . "*/\n";
80 print "const unicode_char unicode_case_tab[][4]={\n";
84 for ($i=0; $i<$tabsize; $i++)
100 printf("{0x%04x,0x%04x,0x%04x,0x%04x},",$j,$u,$l,$t);
101 print "\n" if ($idx % 4) == 3;
104 } split(/\n/, $bucket[$i]);
108 const unsigned unicode_case_offset[$tabsize]={
111 for ($i=0; $i<$tabsize;$i++)
113 printf("%4d", $offset[$i]);
114 print "," if $i < $tabsize-1;
116 print "\n" if ($i % 16) == 15;