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