sksp2024-mcu/libucw/charset/misc/import-unicode_org
2024-09-14 21:50:33 +02:00

28 lines
601 B
Perl
Executable file

#!/usr/bin/perl
# Import charset tables from ftp.unicode.org
# (c) 2003, Robert Spalek <robert@ucw.cz>
foreach $file (@ARGV)
{
print "Converting $file\n";
($prefix, $filename) = $file =~ m|^(.*/)([^/]*)$|;
open(fi, "<$file") || die;
open(fo, ">$file-tr") || die;
print fo "# $filename charset file
# Imported from ftp://ftp.unicode.org/Public/MAPPINGS/$file
# (c) 2003, Robert Spalek <robert\@ucw.cz>
";
while (<fi>)
{
next if /^#/;
chop;
if (($code, $unicode, $comment) = /^0x(..)\t0x(....)\t#\t?(.*)$/)
{
print fo "$code\t$unicode\t$comment\n";
}
}
close(fo);
close(fi);
}