2
누군가이 스 니펫이 다음 오류로 인해 왜 실패하는지 알려 줄 수 있습니까? 나는 또한 성공을 가진 from_to()
를 부르기 전에 utf8::downgrade()
를 시도했다. Perl 5.14.2 사용.Perl UTF8 - UTF16 변환 오류 - 와이드 문자
어떤 아이디어 ??
코드 :
use Encode qw(from_to);
use HTML::Entities;
$s = "มหัศ";
$foo = decode_entities($s);
print "is foo UTF8? ", utf8::is_utf8($foo), "\n";
from_to($foo, 'UTF-8', 'UTF-16');
출력 : 모든
is foo UTF8? 1
Cannot decode string with wide characters at /usr/lib/perl/5.14/Encode.pm line 194.