]> mj.ucw.cz Git - libucw.git/blob - charset/misc/import-unicode_org
Renamed unisplit to gen-basic.
[libucw.git] / charset / misc / import-unicode_org
1 #!/usr/bin/perl
2 #       Import charset tables from ftp.unicode.org
3 #       (c) 2003, Robert Spalek <robert@ucw.cz>
4
5 foreach $file (@ARGV)
6 {
7         print "Converting $file\n";
8         ($prefix, $filename) = $file =~ m|^(.*/)([^/]*)$|;
9
10         open(fi, "<$file") || die;
11         open(fo, ">$file-tr") || die;
12         print fo "# $filename charset file
13 # Imported from ftp://ftp.unicode.org/Public/MAPPINGS/$file
14 # (c) 2003, Robert Spalek <robert\@ucw.cz>
15
16 ";
17         while (<fi>)
18         {
19                 next if /^#/;
20                 chop;
21                 if (($code, $unicode, $comment) = /^0x(..)\t0x(....)\t#\t?(.*)$/)
22                 {
23                         print fo "$code\t$unicode\t$comment\n";
24                 }
25         }
26         close(fo);
27         close(fi);
28 }