in reply to Re: XML::Simple, Switch and UTF8 errors
in thread XML::Simple, Switch and UTF8 errors

Yep. I had not included it because it was not "special":
$VAR1 = "combo";
It looks that way on the screen, too.

BTW, I have even tried changing the encoding parameter in the XML. If it matters, this is all under ActiveState 5.8.1 on XP. The XML was created using Notepad...

--traveler

Replies are listed 'Best First'.
Re: Re: Re: XML::Simple, Switch and UTF8 errors
by ysth (Canon) on Feb 02, 2004 at 23:29 UTC
    Reduced the problem to this:
    $ perl -we'$x = "combo\x{fff}"; chop($x); 0 eq (~$x&$x)' Useless use of string eq in void context at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x9c, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x90, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x92, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x9d, with no +preceding start byte) in bitwise and (&) at -e line 1. Malformed UTF-8 character (unexpected continuation byte 0x90, with no +preceding start byte) in bitwise and (&) at -e line 1.
    Switch.pm is using a peculiarity of ~ and & operator to see if the value is a number or a string, and it's failing when the value being switched upon has the UTF8 flag set but no characters with code points > 255.

    This seems to be a bug in ~: it's returning non-UTF8 with the UTF8 flag set.

    Update: This was fixed just a few days ago (see perlbug #24926).