Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: khw [...] cpan.org
Cc:
AdminCc:

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



The bug against Perl5 at https://rt.perl.org/rt3/Ticket/Display.html?id=38812 may very well be an Encode error. If one uses valgrind on this program from that ticket: use strict; #use Devel::Peek; my @t = qw/230 13 90 65 34 239 86 15 8 26 181 25 305 123 22 139 111 6 3 100 37 1 20 1 166 1 300 19 1 42 153 81 106 114 67 1 32 34/; open OUT, '>:encoding(iso-8859-1)', 'out.xml' or die "$!"; my $string = join "\x{fffd}", map { '.'x$_ } @t; #Dump $string; print OUT $string; close OUT or die "$!"; one gets errors about using uninitialized values. It turns out that Encode is calling utf8n_to_uvchr() with bad data. Here is the relevant line from the output: encode_method(interpreter*, encode_s const*, encpage_s const*, sv*, int, unsigned int*, sv*, int*, sv*) (Encode.xs:182)
I also took a look at https://rt.perl.org/rt3//Public/Bug/Display.html?id=38812 and found if it is due to the hard-codeded buffer size of 1024 @ PerlIO::encoding, Encode.pm cannot solve this problem alone. Dan the Encode Maintainer On Sat Jun 22 12:00:02 2013, khw wrote: Show quoted text
> The bug against Perl5 at > https://rt.perl.org/rt3/Ticket/Display.html?id=38812 > may very well be an Encode error. If one uses valgrind on this > program from that ticket: > > use strict; > #use Devel::Peek; > > my @t = qw/230 13 90 65 34 239 86 15 8 26 181 25 305 123 22 139 111 6 > 3 > 100 37 1 20 1 166 1 300 19 1 42 153 81 106 114 67 1 32 34/; > open OUT, '>:encoding(iso-8859-1)', 'out.xml' or die "$!"; > my $string = join "\x{fffd}", map { '.'x$_ } @t; > #Dump $string; > print OUT $string; > close OUT or die "$!"; > > one gets errors about using uninitialized values. It turns out that > Encode is calling utf8n_to_uvchr() with bad data. Here is the > relevant line from the output: > > encode_method(interpreter*, encode_s const*, encpage_s const*, sv*, > int, unsigned int*, sv*, int*, sv*) (Encode.xs:182)