error in

Mel Wilson mwilson at the-wire.com
Fri May 9 10:08:55 EDT 2003


In article <1147e466.0305082005.269cf5f2 at posting.google.com>,
blunck at gst.com (Christopher Blunck) wrote:
>mod = __import__('encodings.utf_8', globals(), locals(), '*')
>mod = __import__('encodings.utf_16_be', globals(), locals(), '*')
>
>Of course, this is somewhat hackish because one isn't suppose to know
>the encodings of an XML message prior to manipulating / parsing it.
>But, it solves the imeediate problem, and most XML docs are UTF8 or
>UTF16 formatted.

   No, it's decent.  Everything is in some encoding; the
fact that we've lived all our lives up to now in one
encoding and not noticed doesn't change that.  The XML
parser has to be able to recognize the characters (e.g.)
'encoding="KOI8-R"' when it comes across the coding for them
in the text declaration.

   Like _XML in a Nutshell_ says, "An XML parser is required
to handle the UF-16 and UTF-8 encodings or Unicode."

        Regards.        Mel.




More information about the Python-list mailing list