1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/usr/bin/perl
# Print a map of characters from kmap.
# Gaspar Sinai <gaspar yudit org> 2020-05-17, Tokyo
$uniconv = "/home/gsinai/Test/bin/uniconv";
while (<>) {
chop;
$line=$_;
next unless (/(.*) -> (.*) #(.*)$/);
$input = $1;
$chars = $2;
$comment = $3;
@ch = split (" ", $chars);
foreach (@ch) {
s/^[0]+//;
printf ("U+%s ", $_);
}
$input =~ s/''/MAKKA/g;
$input =~ s/'//g;
$input =~ s/ //g;
$input =~ s/MAKKA/'/g;
$minput = $input;
$minput =~ s/"/\\"/g;
$output = `echo "$minput " | uniconv -decode OldHungarian`;
print ("$comment ($input) $output");
}
|