Subject: | Encode::GSM0338 does not handle coderef in CHECK |
Hi!
Encode supports putting coderefs in CHECK to handle malformed data.
Encode::GSM0338 does not handle this. If you pass a coderef, it just
dies. See attached script, which (according to the spec) should print
out "A" followed by 'in check sub'. But it just croaks with
\x{00a9} does not map to gsm0338 at
/usr/lib/perl5/5.8.8/i686-linux/Encode.pm line 146
The problem probably lies in Encode/GSM0338/pm, lines 222 ff, where it
isn't checked if $chk is a coderef.
Thanks!
Subject: | encode_gsm0338.pl |
use strict;
use warnings;
use Encode;
my $t='A '.chr(0xa9);;
print encode('gsm0338',$t,sub { return 'in check sub'} );
print "\n";