From 335ee5e5f5f11528ecc8ae901cfccd7d75209aa1 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Fri, 27 Jun 2003 12:39:50 +0000 Subject: [PATCH] fixed handling of characters lost by recoding --- charset/misc/mkcharset | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/charset/misc/mkcharset b/charset/misc/mkcharset index b9275364..07b5a854 100755 --- a/charset/misc/mkcharset +++ b/charset/misc/mkcharset @@ -15,8 +15,8 @@ foreach $charset (@ARGV) while () { chop; - (($number, $char) = /^([0-9A-F]{2})\t(.)$/) || die "Cannot parse $_"; - $recode[hex $number] = ord $char; + (($number, $char) = /^([0-9A-F]{2})\t(.?)$/) || die "Cannot parse $_"; + $recode[hex $number] = $char ne "" ? ord $char : -1; } $#recode >= 0 || die "Empty recoding table"; $recode[10] = 10; @@ -24,7 +24,8 @@ foreach $charset (@ARGV) for ($i=0; $i<=$#recode; $i++) { - printf fo "%02X\t%04X\n", $i, $recode[$i]; + printf fo "%02X\t%04X\n", $i, $recode[$i] + if $recode[$i] >= 0; } close(fo); -- 2.39.5