Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 31335
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: domm [...] cpan.org
mschipany [...] verisign.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.23
Fixed in: (no value)



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";
This will be fixed in the next version. ==== % perl -Mblib use strict; use warnings; use Encode; my $t='A '.chr(0xa9);; print encode('gsm0338',$t,sub { sprintf "U+%04X in check sub", $_[0]} ); print "\n"; A U+00A9 in check sub ==== Dan the Maintainer Thereof On Mon Dec 10 05:20:47 2007, DOMM wrote: Show quoted text
> 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!