--On 15. Januar 2007 13:26:16 +0100 Martijn Faassen <[EMAIL PROTECTED]> wrote:


How would you propose to parse the following unicode string?

u"<?xml version="1.0" encoding="ISO-8859-1"?><foo />"

If your parser is unicode-aware then the encoding of the preamble
does not matter since you have already unicode internally and can process your file totally on XML.

If your parser isn't unicode-aware then you will likely convert it to
utf-8 and work internally with utf-8 encoded strings. In fact xml.parsers.expat since to support unicode (it can return unicode strings
to the handlers, see 'returns_unicode' property). However you need to
reconstruct the XMl preamble when you reconstruct your XML from the
parsed data.

Or am I missing something?

Andreas

Attachment: pgpQNy99FMGyu.pgp
Description: PGP signature

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to