[Zope-dev] Should PageTemplate._text be a unicode or an encoded string in Zope 2.9.3?

Andreas Jung lists at zopyx.com
Sat Jul 22 10:24:30 EDT 2006



--On 22. Juli 2006 16:17:09 +0200 Tino Wildenhain <tino at wildenhain.de> 
wrote:
>> huh?..even on the file system a pt file is encoded using some encoding.
>> For an XML pagetemplate file the encoding is clearly defined through
>> the BOM (if available) and/or the XML preamble. So the most reliable
>> solution would be to use XML PTs only.
>
> Yes but you have to explicitely store that information "somehow" in the
> file - zope objects can use other methods to transfer encoding information
> while they create the internal representation.
> meta-tags for charset are quite ugly but you basically have no other
> choice with filesystem stuff.
> Problem here if the various encoding notifications collide (XML header
> vs. XHTML meta-tag vs. BOM) so better have as few as possible - even
> better none when

I am only talking of XML. And the encoding is clearly and unambiguously 
defined through the BOM (if available) and the XML preamble. So any 
application reading an XML file is able to detect the encoding and produce
a unicode string from the file. According to a discussion with Dieter the 
Python XML parsers don't deal with the BOM and leave it up to the 
application to interpret the BOM correctly.

-aj 
-------------- 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/zope-dev/attachments/20060722/8852e5de/attachment.bin


More information about the Zope-Dev mailing list