in reply to XML::Simple and encoding

I did some digging and I bet the parser assumes the document uses UTF-8 (since you didn't specify otherwise), and that your document is not in UTF-8. Try providing the appropriate encoding. The underlying parser (expat) pays attention to the encoding parameter in the XML declaration, so it might be as easy as specifying it.

<?xml version="1.0" encoding="ISO-8859-1"?>

Replies are listed 'Best First'.
Re^2: XML::Simple and encoding
by ikegami (Patriarch) on Dec 31, 2006 at 01:01 UTC

    I did a bit more research, and it looks like it's not a bug or limitation of the parser. Your XML document is bad. According to Extensible Markup Language (XML) 1.0 (Fourth Edition),

    In the absence of information provided by an external transport protocol (e.g. HTTP or MIME), it is a fatal error for an entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF-8.

    Make sure to use something like

    <?xml version="1.0" encoding="ISO-8859-1"?>