From bbecaa41b28681d20c2c25d68e78f63bc458b6a1 Mon Sep 17 00:00:00 2001 From: imiyazaki Date: Fri, 7 Nov 2003 16:09:35 +0000 Subject: [PATCH] support 5.8 only. --- Chise_utils/Chise_utils.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Chise_utils/Chise_utils.pm b/Chise_utils/Chise_utils.pm index 257f27a..961970b 100644 --- a/Chise_utils/Chise_utils.pm +++ b/Chise_utils/Chise_utils.pm @@ -1,6 +1,6 @@ package Chise_utils; -require 5.005; +require 5.008; use strict; use warnings; @@ -42,7 +42,7 @@ our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); -our $VERSION = '0.01'; +our $VERSION = '0.02'; # Preloaded methods go here. @@ -159,9 +159,11 @@ sub get_reverse_db{ sub get_char_attribute{ my($char,$atr)=@_; + my($res); &get_db($atr) or return ""; - if($chardb{$atr}->{"?$char"}){ - return $chardb{$atr}->{"?$char"}; + if($res=$chardb{$atr}->{"?$char"}){ + utf8::decode($res); + return $res; }else{ return ""; } @@ -173,6 +175,7 @@ sub get_chars_containing{ if(&get_db($atr)){ foreach $char (keys %{$chardb{$atr}}){ if($chardb{$atr}->{$char}=~/$value/){ + utf8::decode($char); $char=~s/^\?//; push @res,$char; } @@ -187,6 +190,7 @@ sub get_chars_matching{ if(defined($reverse_db{$atr})){ if(&get_reverse_db($atr)){ if($char=$reverse_chardb{$atr}->{$value}){ + utf8::decode($char); $char=~s/^\?//; push @res,$char; } @@ -199,6 +203,7 @@ sub get_chars_matching{ if(&get_db($atr)){ foreach $char (keys %{$chardb{$atr}}){ if($chardb{$atr}->{$char} eq $value){ + utf8::decode($char); $char=~s/^\?//; push @res,$char; } -- 1.7.10.4