From: imiyazaki Date: Thu, 2 Sep 2004 13:57:05 +0000 (+0000) Subject: add utf8::decode(). X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fperl.git;a=commitdiff_plain;h=a463c9c9a1235ababdbc3015044c8871a58c9ea6 add utf8::decode(). --- diff --git a/Chise_utils/scripts/sample.pl b/Chise_utils/scripts/sample.pl index 3e27d28..6d3d0f3 100644 --- a/Chise_utils/scripts/sample.pl +++ b/Chise_utils/scripts/sample.pl @@ -8,6 +8,7 @@ use vars qw($atr $value $char $opt_query $opt_help ); +use utf8; use Chise_utils ':all'; require 5.008001; @@ -67,8 +68,9 @@ if($opt_map){ if(&get_db($opt_map)){ foreach $char (sort keys %{$chardb{$opt_map}}){ utf8::decode($char); - if($chardb{$opt_map}->{$char}){ - print $char,"\t",$chardb{$opt_map}->{$char},"\n"; + if($value=$chardb{$opt_map}->{$char}){ + utf8::decode($value); + print $char,"\t",$value,"\n"; } } }else{ @@ -78,8 +80,9 @@ if($opt_map){ if(&get_reverse_db($opt_rev_map)){ foreach $char (sort keys %{$reverse_chardb{$opt_rev_map}}){ utf8::decode($char); - if($reverse_chardb{$opt_rev_map}->{$char}){ - print $char,"\t",$reverse_chardb{$opt_rev_map}->{$char},"\n"; + if($value=$reverse_chardb{$opt_rev_map}->{$char}){ + utf8::decode($value); + print $char,"\t",$value,"\n"; } } }else{