@NAME = (); while() { chop; s/\s*$//; (($n, $m, $c) = split(" ", $_, 3)) >= 3 || next; push(@NAME, $n); $MAP{$n} = $m; $CODE{$n} = $c; } $name0 = "jisx0208x0212x0213"; # print OUT < ${name0}_ucs.map"); foreach $name (@NAME) { $code = $CODE{$name}; $map = $MAP{$name}; print "$name\t$map\t$code\n"; open(MAP, "< $map"); while() { /^#/ && next; s/#.*//; if ($name =~ /0208/) { (($s, $i, $u) = split(" ")) || next; $i = hex($i); $u = hex($u); if ($u == 0x5C) { $u = 0xFF3C; } $to_ucs[$i] || ($to_ucs[$i] = $u); $to_ucs_jis[$i] = 0; $from_ucs{$u} = $i; } elsif ($name =~ /0212/) { (($i, $u) = split(" ")) || next; $i = hex($i); $u = hex($u); if ($u == 0x7E) { $u = 0xFF5E; } $to_ucs2[$i] = $u; $to_ucs2_jis[$i] = 0; $from_ucs2{$u} = $i; } else { /^\d/ || next; (($p,$i,$e,$s,$u) = split(" ")) || next; $i =~ s/j-/0x/; $u =~ s/u-/0x/; $i = hex($i); $u = hex($u); if ($u == 0xffff) { $u = 0; } if ($u == 0x7E) { $u = 0xFF5E; } if ($p =~ /^1/) { $to_ucs[$i] && next; $to_ucs[$i] = $u; $to_ucs_jis[$i] = 1; $from_ucs3{$u} = $i; } elsif ($p =~ /^2/) { $to_ucs2[$i] = $u; $to_ucs2_jis[$i] = 1; $from_ucs4{$u} = $i; } } } } print OUT < $b } keys %from_ucs; $nucs = @ucs + 0; print OUT < $b } keys %from_ucs2; $nucs = @ucs + 0; print OUT < $b } keys %from_ucs3; $nucs = @ucs + 0; print OUT < $b } keys %from_ucs4; $nucs = @ucs + 0; print OUT <