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_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 <