X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=charset%2Fmisc%2Fgen-charconv;h=ab22b1563d0465be597d5f40f9e1b17caff1a910;hb=189a92227b098d2a08cbcb7c091d13ce6c8680b3;hp=28660d1d3f23cd0576d53d6c475f1198421e4279;hpb=e7fcdfa74bd4ee6d8d38c3f4e0487f249fe468df;p=libucw.git diff --git a/charset/misc/gen-charconv b/charset/misc/gen-charconv index 28660d1d..ab22b156 100755 --- a/charset/misc/gen-charconv +++ b/charset/misc/gen-charconv @@ -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 () { chomp; ($num,$name,$_,$_,$_,$exp) = split /;/; @@ -110,17 +110,30 @@ while () { } close U; +print STDERR "Accent rules\n"; +if (open(ACC, "misc/user_unacc")) { + while () { + 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 () { 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++) {