Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: XML Parser not well-formedby bart (Canon) |
on Nov 04, 2004 at 14:13 UTC ( [id://405172]=note: print w/replies, xml ) | Need Help?? |
That character looks like one of Microsoft's additions to ISO-Latin-1, somewhere in the range 128-159.
Don't do that. Your XML is invalid because of it. Please don't try to patch the XML parser to accept it, you're making life harder for everybody — XML parsers merciless rejecting invalid XML is a feature, forcing people to produce proper XML. Guessswork isn't doing anybody any good. Instead, replace it with the proper Unicode character in the proper character encoding (UTF-8?) or as a numerical entity, in the XML file. It ought to work then. You can find the equivalent character code (in hex) in that table I linked to, and it would seem to me that this is the one: 0x92 0x2019 #RIGHT SINGLE QUOTATION MARK So "’" ought to do it. Test: "’" p.s. Actually, you should get the source of the data to fix it, they did not do a proper job.
In Section
Seekers of Perl Wisdom
|
|