]> mj.ucw.cz Git - libucw.git/commitdiff
added a tool for importing mappings from ftp.unicode.org
authorRobert Spalek <robert@ucw.cz>
Fri, 4 Jul 2003 12:26:26 +0000 (12:26 +0000)
committerRobert Spalek <robert@ucw.cz>
Fri, 4 Jul 2003 12:26:26 +0000 (12:26 +0000)
I will rather use this source than `recode`

charset/misc/trunicode [new file with mode: 0755]

diff --git a/charset/misc/trunicode b/charset/misc/trunicode
new file mode 100755 (executable)
index 0000000..73f5d37
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+foreach $file (@ARGV)
+{
+       print "Converting $file\n";
+
+       open(fi, "<$file") || die;
+       open(fo, ">$file-tr") || die;
+       print fo "# $file charset file
+# Imported from ftp://ftp.unicode.org/Public/MAPPINGS/$file
+# (c) 2003, Robert Spalek <robert@ucw.cz>
+
+";
+       while (<fi>)
+       {
+               next if /^#/;
+               chop;
+               ($code, $unicode, $comment) = /^0x(..)\t0x(....)\t#\t(.*)$/;
+               print fo "$code\t$unicode\t$comment\n";
+       }
+       close(fo);
+       close(fi);
+}