Created
October 20, 2011 06:07
-
-
Save tagomoris/1300534 to your computer and use it in GitHub Desktop.
Encode::decode_utf($str, 1) bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Data::Dumper; | |
my $x = {1 => "ichi", 2 => "ni"}; | |
warn Dumper $x; | |
{ | |
use Encode; | |
my $decoded = Encode::decode_utf8($x->{1}, 1); | |
local $x->{1} = $decoded; | |
warn Dumper $x; | |
} | |
warn Dumper $x; | |
# $ perl -MEncode -E 'say $Encode::VERSION' | |
# 2.42 | |
###### output | |
# $VAR1 = { | |
# '1' => 'ichi', | |
# '2' => 'ni' | |
# }; | |
# $VAR1 = { | |
# '1' => 'ichi', | |
# '2' => 'ni' | |
# }; | |
# $VAR1 = { | |
# '1' => '', | |
# '2' => 'ni' | |
# }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使いかたの問題だった。
checkに Encode::LEAVE_SRC を渡せばよい