●awstatsの文字化け
+use Jcode;
sub DecodeEncodedString {
my $stringtodecode=shift;
$stringtodecode =~ tr/\+/ /s;
$stringtodecode =~ s/%([A-F0-9][A-F0-9])/pack(”C”, hex($1))/ieg;
+ Jcode::convert(\$stringtodecode, "utf8");
return $stringtodecode;
}
« Webdav | メイン | pdo_mysql »
+use Jcode;
sub DecodeEncodedString {
my $stringtodecode=shift;
$stringtodecode =~ tr/\+/ /s;
$stringtodecode =~ s/%([A-F0-9][A-F0-9])/pack(”C”, hex($1))/ieg;
+ Jcode::convert(\$stringtodecode, "utf8");
return $stringtodecode;
}
このエントリーのトラックバックURL:
http://www.fatcat-hosting.net/mt-tb.cgi/149