8 # Too painful to figure out how to get Perl to do it.
9 system 'wget -o .wget-log http://www.unicode.org/Public/UNIDATA/Blocks.txt';
17 open (INPUT, "< $file") || die "couldn't open $file: $!";
26 ($start, $to, $text) = split (/; /);
27 ($symbol = $text) =~ tr/a-z/A-Z/;
28 $symbol =~ s/[- ]/_/g;
30 # Special case for one of the SPECIALS.
31 next if $start eq 'FEFF';
33 # Special case some areas that our heuristic mishandles.
34 if ($symbol eq 'HIGH_SURROGATES')
36 $symbol = 'SURROGATES_AREA';
37 $text = 'Surrogates Area';
40 elsif ($symbol =~ /SURROGATES/)
44 elsif ($symbol eq 'PRIVATE_USE')
47 $text = 'Private Use Area';
50 printf " public static final UnicodeBlock %s = new UnicodeBlock (\"%s\", '\\u%s', '\\u%s');\n",
51 $symbol, $text, $start, $to;
53 push (@array, $symbol);
56 printf " private static final UnicodeBlock[] blocks = {\n";
60 printf "," unless $_ eq 'SPECIALS';