]> mj.ucw.cz Git - libucw.git/blobdiff - charset/misc/gen-charconv
Just fixed a comment in libimages.
[libucw.git] / charset / misc / gen-charconv
index 28660d1d3f23cd0576d53d6c475f1198421e4279..ab22b1563d0465be597d5f40f9e1b17caff1a910 100755 (executable)
@@ -93,7 +93,7 @@ for($i=0; $i<256; $i++) {
 print "};\n\n";
 
 print STDERR "UniData file...\n";
-open (U, "unicode/UnicodeData.txt") || die "No UnicodeData file";
+open (U, "unidata/UnicodeData.txt") || die "No UnicodeData file";
 while (<U>) {
        chomp;
        ($num,$name,$_,$_,$_,$exp) = split /;/;
@@ -110,17 +110,30 @@ while (<U>) {
 }
 close U;
 
+print STDERR "Accent rules\n";
+if (open(ACC, "misc/user_unacc")) {
+       while (<ACC>) {
+               chomp;
+               (/^\s*$/ || /^#/) && next;
+               s/0x([0-9a-zA-Z]+)/hex($1)/ge;
+               (/^(\d+)\s+(\d+)$/) || die "Syntax error in user accent rules";
+               $expand{$1} = $2;
+       }
+       close ACC;
+}
+
 print STDERR "Character expansions\n";
 if (open(EXTRA, "misc/user_expand")) {
        while (<EXTRA>) {
                chomp;
                (/^\s*$/ || /^#/) && next;
                s/0x([0-9a-zA-Z]+)/hex($1)/ge;
-               (/^(\S+)\s+(.*)$/) || die "Syntax error in user expansions";
+               (/^(\d+)\s+(.*)$/) || die "Syntax error in user expansions";
                $expand{$1} = $2;
        }
        close EXTRA;
 }
+
 print "static unsigned short int x_to_output[$ncs][$unique] = {\n";
 $pstr = 256;
 for($c=0; $c<$ncs; $c++) {