From 604c11affe988bab23c87598c02248fff1d73f43 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Mon, 22 Sep 2003 21:02:15 +0000 Subject: merge m17n patch add libwc --- libwc/map/mk_hkscs_ucs_p2_map.pl | 81 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 libwc/map/mk_hkscs_ucs_p2_map.pl (limited to 'libwc/map/mk_hkscs_ucs_p2_map.pl') diff --git a/libwc/map/mk_hkscs_ucs_p2_map.pl b/libwc/map/mk_hkscs_ucs_p2_map.pl new file mode 100644 index 0000000..f68d175 --- /dev/null +++ b/libwc/map/mk_hkscs_ucs_p2_map.pl @@ -0,0 +1,81 @@ + +@NAME = (); +while() { + chop; + s/\s+$//; + (($n, $m, $d) = split(" ", $_, 3)) >= 3 || next; + push(@NAME, $n); + $MAP{$n} = $m; + $DESC{$n} = $d; +} + +%to_ucs = (); +%from_ucs = (); + +foreach $name (@NAME) { + +$map = $MAP{$name}; +$desc = $DESC{$name}; +print STDERR "$name\t$map\t$desc\n"; + +open(MAP, "< $map"); +while() { + (($c, $u) = split(" ")) || next; + $c = hex($c); + $u = hex($u); + if (($c < 0xA140 || $c > 0xF9FE) && + ($u > 0x20000)) { + $u &= 0xFFFF; + $to_ucs{$c} = $u; + $from_ucs{$u} = $c; + } +} +close(MAP); + +} + +$name = $NAME[0]; +$desc = $DESC{$name}; + +open(OUT, "> ${name}_ucs_p2.map"); + +@ucs = sort { $a <=> $b } keys %to_ucs; +$nucs = @ucs + 0; + +print OUT < $b } keys %from_ucs; +$nucs = @ucs + 0; + +print OUT <