From 5f8e0f8ef9a422691dd72e8a953a42a41478fcb4 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Wed, 4 May 2011 16:18:09 +0900 Subject: Releasing debian version 0.5.1-1 --- libwc/map/mk_jisx0213_ucs_map.pl | 104 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 libwc/map/mk_jisx0213_ucs_map.pl (limited to 'libwc/map/mk_jisx0213_ucs_map.pl') diff --git a/libwc/map/mk_jisx0213_ucs_map.pl b/libwc/map/mk_jisx0213_ucs_map.pl new file mode 100644 index 0000000..9dc5b73 --- /dev/null +++ b/libwc/map/mk_jisx0213_ucs_map.pl @@ -0,0 +1,104 @@ + +@NAME = (); +while() { + chop; + s/\s*$//; + (($n, $m, $c) = split(" ", $_, 3)) >= 3 || next; + push(@NAME, $n); + $MAP{$n} = $m; + $CODE{$n} = $c; +} + +foreach $name (@NAME) { + +$code = $CODE{$name}; +$map = $MAP{$name}; + +print "$name\t$map\t$code\n"; + +open(MAP, "< $map"); +while() { + /^#/ && next; + s/#.*//; + (($u, $s, $i) = split(" ")) || next; + $u =~ s/^U\+2//; + if ($i =~ s/3-//) { + $i = hex($i); + $u = hex($u); + $to_ucs1{$i} = $u; + $from_ucs1{$u} = $i; + } elsif ($i =~ s/4-//) { + $i = hex($i); + $u = hex($u); + $to_ucs2{$i} = $u; + $from_ucs2{$u} = $i; + } +} +open(OUT, "> ${name}_ucs.map"); + +@ucs = sort { $a <=> $b } keys %to_ucs1; +$nucs = @ucs + 0; +print OUT < $b } keys %from_ucs1; +$nucs = @ucs + 0; +print OUT < $b } keys %to_ucs2; +$nucs = @ucs + 0; +print OUT < $b } keys %from_ucs2; +$nucs = @ucs + 0; +print OUT <