From 04d470334f8c961c7dc4cf6bab196ed288208ce8 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Sun, 5 Oct 2003 17:39:35 +0000 Subject: [PATCH] fix get_char_in_utf8mcs() --- chise2otf/chise2otf | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/chise2otf/chise2otf b/chise2otf/chise2otf index 1e662ec..6351d7f 100755 --- a/chise2otf/chise2otf +++ b/chise2otf/chise2otf @@ -69,13 +69,14 @@ if(not defined($opt_in_cs)){ print STDERR "Assuming input coding system is ucs\@mcs.\n"; $in_cs='ucs@mcs'; }else{ - if(($opt_in_cs ne 'ucs@mcs')or - ($opt_in_cs ne 'ucs@cns')or - ($opt_in_cs ne 'ucs@gb')or - ($opt_in_cs ne 'ucs@jis')or - ($opt_in_cs ne 'ucs@ks')){ + if(($opt_in_cs eq 'ucs@mcs')or + ($opt_in_cs eq 'ucs@cns')or + ($opt_in_cs eq 'ucs@gb')or + ($opt_in_cs eq 'ucs@jis')or + ($opt_in_cs eq 'ucs@ks')){ $in_cs=$opt_in_cs; }else{ + print STDERR "Invalid arguments.\n"; print STDERR $usage; exit 1; } @@ -358,9 +359,12 @@ sub get_char_in_ucsmcs{ my($output_char); if(&get_reverse_db("=$in_cs")){ - if($output_char=$reverse_chardb{"=$in_cs"}->{$char}){ + if($output_char=$reverse_chardb{"=$in_cs"}->{unpack("U",$char)}){ $output_char=decode('utf8',$output_char) if($perl58); - return $output_char=~s/^\?//; + $output_char=~s/^\?//; + return $output_char; + }else{ + return $char; } }else{ return $char; -- 1.7.10.4