perl-unicode

Re: Warning messages for ill-formed data

2003-03-24 22:30:06
On Tuesday, Mar 25, 2003, at 13:59 Asia/Tokyo, Mark Lewellen wrote:
Is there a way to cause Encode to display warnings for upper ascii
outside of the Big5 range when converting from Big5 to Unicode? If not, could
the developers consider this for a future fix?

Use the optional 3rd argument to decode().

$utf8 = decode("Big5" => $big5); # ill-formed chars are mapped to U+FFFD
$utf8 = decode("Big5" => $big5, Encode::FB_WARN); # same but warnings issued

see "Handling Malformed Data" of "perldoc Encode" for how to use the 3rd argument.

Dan the Encode Maintainer