add utf8::decode().
authorimiyazaki <imiyazaki>
Thu, 2 Sep 2004 13:57:05 +0000 (13:57 +0000)
committerimiyazaki <imiyazaki>
Thu, 2 Sep 2004 13:57:05 +0000 (13:57 +0000)
Chise_utils/scripts/sample.pl

index 3e27d28..6d3d0f3 100644 (file)
@@ -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{