Mercurial > hg > Applications > 14x14ja
view findUnicode.pl @ 3:0285a01caf93
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 15 Jun 2013 18:23:21 +0900 |
parents | 7f5d4dad9d6b |
children | 8da43f287516 |
line wrap: on
line source
#!/usr/bin/perl # find used unicode use strict; use utf8; use open qw(:std :utf8); # input/output default encoding will be UTF-8, it looks like default my %used; while(<>) { for my $ch ( /(.)/g ) { next if (ord($ch)<128); next if (ord($ch)>12288); # ignore CJKV $used{ord($ch)}++; } } for my $bdf (<[0-9]*.bdf>) { open(my $f,"<",$bdf); my %has; while(<$f>) { if (/^ENCODING\s+(\d+)/) { my $encoding=$1; $has{$encoding} = 1; } } my %no; for my $ch ( keys %used ) { $no{$ch} ++ if (! defined $has{$ch}) ; } for my $ch ( sort {$a<=>$b} keys %no ) { my $hex = sprintf("%x",$ch); print chr($ch)," $ch 0x$hex is not in $bdf\n"; } }