Sax2 encoding

Juan M. Casillas juanm.casillas at
Fri Aug 30 14:40:20 CEST 2002

>>>>> "Alexandre" == Alexandre Fayolle <alf at> writes:


    >> I have an xml document that only begins with
    >> <?xml version="1.0"?> [...]
    >> That is, without no info about the encoding. This document has
    >> special characters encoded in ISO-8859-1 format (spanish
    >> characters just like á, or ñ).

    Alexandre> Then your document is not well formed XML, and you will
    Alexandre> have big trouble parsing it. It should begin with <?xml
    Alexandre> verions="1.0" encoding="iso-8859-1"?>

    Alexandre> If you can't change this yourself, you should ask the
    Alexandre> author to do it.  And if he doesn't want, you should
    Alexandre> convert it to utf-8 using python's codec module before
    Alexandre> parsing it.

		Yes, I have malformed XML files :) I will do it.
	Thanks for your help

	Juan M. Casillas

More information about the Python-list mailing list