perl-unicode

Endless loop with illegal UTF-8 in Encode.pm

2003-08-29 16:47:14
Hi,

I'm seeing a script using XML::Simple go berserk (eats CPU + Memory) when feeding it XML with illegal UTF-8.

The perl debugger is telling me it's jumping around in Encode.pm
between line 187 ("sub decode_utf8") and line 246 ("*decode = sub {...").

It's doing something like:
     my $str = Encode::decode_utf8($octets);
and then
     return undef unless utf8::decode($str);
(2 functions calling each other).

Is this a known bug in Encode.pm? Has it been fixed?

My Encode.pm is Version 1.75. It's part of the perl debian package
5.8.0-19 (debian unstable).
I wish Encode.pm would handle invalid UTF-8 in a graceful manner...

Cheers,
-Sven

<Prev in Thread] Current Thread [Next in Thread>