develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #38812] encoding error in UTF-8 locales

Thread Previous | Thread Next
From:
Nicholas Clark via RT
Date:
June 21, 2013 21:09
Subject:
[perl #38812] encoding error in UTF-8 locales
Message ID:
rt-3.6.HEAD-2552-1371848938-1905.38812-15-0@perl.org
On Fri Mar 31 18:15:11 2006, BQW10602@nifty.com wrote:

> It can be simplified more; it smells of some buffer of 1024 bytes.
> 
> use strict;
> open OUT, '>:encoding(iso-8859-1)', 'out.xml' or die "$!";
> my $string = "." x 1022 . "\x{fffd}";
> print OUT $string;
> close OUT or die "$!";
> __END__
> "\x{ffc0}" does not map to iso-8859-1 at ....
> panic: sv_setpvn called with negative strlen at ...

For reference, this test case:

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 "$!";


which Karl created in an attempt to bisect to find the commit which
resolves the "panic", turns out to show errors with valgrind.

So figuring out those may shed more light on this.

Nicholas Clark


---
via perlbug:  queue: perl5 status: stalled
https://rt.perl.org:443/rt3/Ticket/Display.html?id=38812

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About