--On 15. Januar 2007 15:44:01 +0100 Martijn Faassen <[EMAIL PROTECTED]> wrote:

Hey,

On 1/15/07, Andreas Jung <[EMAIL PROTECTED]> wrote:
[snip]
ok, got it. But this problem can be solved easily by changing the
encoding within the preamble.

I would say refusing to guess and bailing out with an error message is
better in this case. The Zen of Python:

In the face of ambiguity, refuse the temptation to guess.


Sorry but I don't get your point. What's happening with a XML inside a ZPT?

- XML data encoded as XXX comes in (either by editing the XML file through
  the ZMI or FTP/WebDAV upload)

- ZPT converts the encoded string to unicode based on the encoding in the preamble

- for parsing it is up to the application to decide what to do with the data. It is not up to the editor to decide how the ZPT engine should deal with XML internally. The ZPT engine decides to serializes the unicode string as utf-8 and to fix the XML preamble (which will result in a valid XML file which should identical with the original file - except the encoding might be different).

I still don't see what should ambiguous with this approach.

Andrea

Attachment: pgpq0GGi0oSZu.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