Re: How do xml parsers handle encoding?



Martin Honnen wrote:

And XML parsers are required to check that documents are properly encoded. However browser like Firefox or Opera I think might not report any such violation. For instance I saved an XML document as UTF-8 but with an XML declaration saying encoding="UTF-16" and then loaded with Firefox 2.0 and Opera 9 and they both did not report an error, instead treated the document as UTF-8. IE 6 reported an error.

For Mozilla, the FAQ http://developer.mozilla.org/en/docs/Mozilla_Web_Developer_FAQ#How_is_the_treatment_of_application.2Fxhtml.2Bxml_documents_different_from_the_treatment_of_text.2Fhtml_documents.3F says:
"Most well-formedness constraints are enforced. (Currently Mozilla does not catch character encoding errors, because the document is re-encoded using a lenient encoding converter before the document reaches the XML parser. This is a bug.)"



--

Martin Honnen
http://JavaScript.FAQTs.com/
.



Relevant Pages

  • Re: Novels into Opera
    ... I do love Orlando, and think that VW almost got away with the ... am going, and will report back, although not here. ... One of my favourite novels of all is Cry the Beloved Country. ... that might work as an opera. ...
    (rec.music.opera)
  • Re: Want Input boxes to accept unicode strings on Standard Window
    ... If ther encoding is not specified, then the encoding is assumed to be ... Ah, UTF-8. ... That would be wrong according to the standard. ... when producing XML files. ...
    (microsoft.public.vc.mfc)
  • Re: Novels into Opera
    ... treatment? ... I wonder if that means I ought to read Orlando before I go. ... am going, and will report back, although not here. ... that might work as an opera. ...
    (rec.music.opera)
  • XSLT: Newbie needs help please.
    ... I'm very new to XML/XSLT but from what I've seen I really like ... I'm building a 'report generation wizard' for an in-house ... The drop down lists are dependent on one another ... represented by XML. ...
    (comp.text.xml)
  • Re: Hard Copy reports
    ... DoD has mandated that all data interchange between system be in XML. ... Report Writer can even be used to generate XML, although it's output is not the most efficient. ... Again, although many/most "customers" like real-time online access to the current state of their accounts/bills, at least in the US, I still see that most such buisness still provide a hard-copy version of monthly bills/statements. ...
    (comp.lang.cobol)