我跑它採用/opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/Encode.pm
的Perl Encode.pm不能與寬字符
,併發出錯誤一個Perl程序解碼字符串
上的/ opt/local/lib目錄無法解碼字符串寬字符/的perl5/5.12.4 /達爾文線程多2level/Encode.pm線174
線Encode.pm
174讀取
sub decode($$;$) {
my ($name, $octets, $check) = @_;
return undef unless defined $octets;
$octets .= '' if ref $octets;
$check ||= 0;
my $enc = find_encoding($name);
unless (defined $enc) {
require Carp;
Carp::croak("Unknown encoding '$name'");
}
my $string = $enc->decode($octets, $check); # line 174
$_[1] = $octets if $check and !ref $check and !($check & LEAVE_SRC());
return $string;
}
任何解決方法?
謝謝,這工作得很好! – MinaHany
切勿使用'_utf8_off'。如果使用is_utf8($ s);'',那麼使用這個函數本質上是有問題的,因爲'_utf8_off($ s)'是'utf8 :: encode($ s)的簡寫。要麼編碼或不要,但不要根據隨機的東西來做! – ikegami