Mercurial > hg > Applications > 14x14ja
comparison findUnicode.pl @ 6:4ed010b4a017
batsu
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 26 Dec 2013 09:01:31 +0900 |
parents | 8da43f287516 |
children | b86def18da67 |
comparison
equal
deleted
inserted
replaced
5:28ee91112a77 | 6:4ed010b4a017 |
---|---|
4 use strict; | 4 use strict; |
5 use utf8; | 5 use utf8; |
6 use open qw(:std :utf8); # input/output default encoding will be UTF-8, it looks like default | 6 use open qw(:std :utf8); # input/output default encoding will be UTF-8, it looks like default |
7 | 7 |
8 my %used; | 8 my %used; |
9 my @fonts = <1[0-9]*.bdf> ; | |
10 | |
11 use Getopt::Std; | |
12 our ($opt_f); | |
13 | |
14 getopts('f:'); | |
15 | |
16 if ($opt_f) { | |
17 @fonts = ($opt_f); | |
18 } | |
9 | 19 |
10 while(<>) { | 20 while(<>) { |
11 for my $ch ( /(.)/g ) { | 21 for my $ch ( /(.)/g ) { |
12 next if (ord($ch)<128); | 22 next if (ord($ch)<128); |
13 # next if (ord($ch)>=12288); # ignore CJKV | 23 # next if (ord($ch)>=12288); # ignore CJKV |
14 $used{ord($ch)}++; | 24 $used{ord($ch)}++; |
15 } | 25 } |
16 } | 26 } |
17 | 27 |
18 for my $bdf (<1[0-9]*.bdf>) { | 28 for my $bdf ( @fonts ) { |
19 open(my $f,"<",$bdf); | 29 open(my $f,"<",$bdf); |
20 my %has; | 30 my %has; |
21 while(<$f>) { | 31 while(<$f>) { |
22 if (/^ENCODING\s+(\d+)/) { | 32 if (/^ENCODING\s+(\d+)/) { |
23 my $encoding=$1; | 33 my $encoding=$1; |