X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/dd5b69ff6ef39a7b8521bac32f2a1aa8ad327729..9314086776a6cd9afc7349082d3acdafa970db09:/tools/mkcharinfo diff --git a/tools/mkcharinfo b/tools/mkcharinfo index b673105..27c11d9 100755 --- a/tools/mkcharinfo +++ b/tools/mkcharinfo @@ -61,6 +61,16 @@ for (keys %diinc) { } } +eval { + # read introducing unicode versions for known characters + my $agemap = do 'unicode-age.inc.pl' or die $@ || $!; + for my $chr (keys %info) { + my $version = $agemap->{ord $chr} or next; + $info{$chr}->{class}->{'u-v'.$version}++ + } + 1; +} or warn "Failed including unicode version data $@"; + for my $chr (keys %info) { my $cp = ord $chr; # attempt to get unicode character information @@ -70,7 +80,7 @@ for my $chr (keys %info) { || { block => '?', category => 'Xn', name => '', script => '' } } or next; - $info->{$_} = $info{$chr}->{$_} for qw(di html class string); + $info->{$_} = $info{$chr}->{$_} for keys %{ $info{$chr} }; # categorise by unicode types and writing script $info->{class}->{$_}++ for $info->{category}; @@ -95,7 +105,9 @@ for my $chr (keys %info) { ? '<'.$info->{unicode10}.'>' # the old name was much more useful : sprintf('', $cp); # at least identify by value # show descriptive symbols instead of control chars themselves - $info->{string} = $cp < 32 ? chr($cp + 0x2400) : chr(0xFFFD); + $info->{string} = $cp < 32 ? chr($cp + 0x2400) : + $cp == 127 ? chr(0x2421) : + chr(0xFFFD); } }