[Zope3-dev] zope.tal.xmlparser.XMLParser() dislikes unicode

Andreas Jung lists at zopyx.com
Sun Jan 14 06:08:55 EST 2007



--On 14. Januar 2007 10:48:06 +0100 Bernd Dorn <zope-mailinglist at mopa.at> 
wrote:

>> I am not sure if this behavior is intentional?! Is the XMLParser
>> supposed
>> to deal with unicode strings or will it only accept a standard
>> Python string? A workaround inside parseString() would to check for
>> unicode
>> and convert the string on-the-fly to a Python string with utf-8
>> encoding.
>> This is possibly a limitation of the underlying Expat parser...any
>> recommendation how to deal with this issue?
>
> IMHO it should only accept strings, because in the value should be a xml
> string and therefore always has to be encoded in 'utf-8' or in the
> encoding specified in the processing instruction.
>

I disagree with that. Since Zope 3 is supposed to use unicode internally
(at least that's the legend) it should support unicode also at the parser 
level. Other languages like Java store XML also as unicode strings and 
support parsing it.

Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20070114/47eb640f/attachment.bin


More information about the Zope3-dev mailing list