From: imiyazaki Date: Fri, 7 Nov 2003 16:09:35 +0000 (+0000) Subject: support 5.8 only. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=bbecaa41b28681d20c2c25d68e78f63bc458b6a1;p=chise%2Fperl.git support 5.8 only. --- 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; }