我正在运行一个使用/opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/Encode.pm的perl应用程序
并发出错误
Cannot decode string with wide characters at /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/Encode.pm line 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; }
任何解决方法?
解决方法
我也有类似的问题.
$enc-> decode($octets,$check);期待八位字节.
$enc-> decode($octets,$check);期待八位字节.
所以放入Encode :: _ utf8_off($octets)之前.它使它为我工作.