Tell libxml to parse the document as ISO8859-1.
It isn't *really* ISO8859-1; we hope it'll be UTF-8. But it doesn't make any difference to the XML parsing, which is all ASCII anyway. It only affects the *content* of the data nodes... and in fact it doesn't matter for those *either* because libxml doesn't attempt to do any translation; it just gives us the strings. The *only* difference that setting ISO8859-1 makes, as far as I know, is that it stops libxml from aborting when it sees legacy 8-bit crap in the content. Which *does* happen with broken mails, especially spam.
Showing with 5 additions and 1 deletion