Re: utf8 bug ?



On Sat, 2004-09-04 at 23:48 +0200, Jan Hudec wrote:
On Sat, Sep 04, 2004 at 21:22:54 +0200, Christian Borup wrote:
On Sat, 2004-09-04 at 10:25 -0400, muppet wrote:
On Sep 3, 2004, at 12:15 PM, Quentin wrote:

On Fri, 2004-09-03 at 15:23, Christian Borup wrote:
This is a bug in perl - which may have been fixed in the latest 
releases
(5.8.5 had a bunch of regexp vs utf8 fixes).

Can you test with perl 5.8.5 and report back? If the problem persists 
I
will pester one of the perl5-porters to fix it.

just now while answering email, i compiled a new perl 5.8.5 and Gtk2 
(all into a sandbox, so i'm presuming i got all the paths right), and i 
still see the panic.

Me too. In fact I've taken Gtk2 out of the equation. The attached
script still crash.

./borup

Content-Description: sv_pos_b2u panic script
use Encode qw( _utf8_on );
my $string='string';
_utf8_on($string);
$_='a %1 b %1';
s/%1/replace($string)/eg;
warn $_;

sub replace
{       $_=shift;
        return $_;
}



This is really strange:

The code:

use utf8;
$s1 = 'string';
$s2 = 'štring';
print "\$s1 ($s1) is " . (utf8::is_utf8($s1) ? '' : 'NOT ') . "unicode\n";
print "\$s2 ($s2) is " . (utf8::is_utf8($s2) ? '' : 'NOT ') . "unicode\n";

Produces:

$s1 (string) is NOT unicode
$s2 (štring) is unicode


This isn't strange - that is exactly what should happen...

Upgrading the first string to unicode is what causes the error, though
the string is ASCII and so is also correct UTF8.

That part is odd. But I'm starting to think that the problem is $_
related if you change the replace function to not use $_, it doesn't
panic.

./borup



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]