3 # Split Unicode Data File
4 # (c) 1997--2001 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
7 open(I, "unicode/UnicodeData.txt") || die "Unable to open UniCode data file";
8 open(C, ">misc/u-cat") || die "cat file open";
9 open(U, ">misc/u-upper") || die "upper file open";
10 open(L, ">misc/u-lower") || die "lower file open";
13 (/^$/ || /^#/) && next;
14 ($code,$name,$cat,$comb,$bidir,$decomp,$d0,$d1,$n0,$mirr,$cmt1,$cmt2,$upper,$lower,$title) = split /;/;
15 $code =~ /^....$/ || next;
16 if ($cat =~ /^C/) { $ccat = "_C_CTRL"; }
17 elsif ($cat =~ /^Z/) { $ccat = "_C_BLANK"; }
18 elsif ($cat =~ /^Ll/) { $ccat = "_C_LOWER"; }
19 elsif ($cat =~ /^Lu/) { $ccat = "_C_UPPER"; }
20 elsif ($code ge "0030" && $code le "0039") { $ccat = "_C_DIGIT|_C_XDIGIT"; }
21 elsif ($code eq "005F") { $ccat = "_C_INNER"; }
23 if ($code ge "0041" && $code le "0046" || $code ge "0061" && $code le "0066") { $ccat = $ccat . "|_C_XDIGIT"; }
24 if ($ccat ne "") { print C "$code\t$ccat\n"; }
25 if ($upper ne "") { print U "$code\t0x$upper\n"; }
26 if ($lower ne "") { print L "$code\t0x$lower\n"; }