[ZPT] Makeing PageTemplate's edit pages Unicode aware

Dieter Maurer dieter at handshake.de
Sat Mar 27 05:57:49 EST 2004


Stuart Bishop wrote at 2004-3-25 12:27 +1100:
>Currently, if you enter non-ascii text into the title or contents
>fields on a PageTemplate's edit page, the data ends up stored as
>an encoded string (using management_page_charset, if it is set. Unknown
>encoding if it is not).
>
>This should be easy to fix using the foo:charset:ustring notation
>to have Zope convert the encoded strings to Unicode. However, the
>file upload  feature is more problematic. Should the file upload
>try converting the file to Unicode from UTF-8 and raise an exception
>if this is not possible? I personally feel this is preferable to
>ending up with arbitrarily enncoded document source, with no idea
>of the character set used.

I do not think that Zope should convert when it does not know the
encoding. I am unaware that a missing "management_page_charset"
can be interpreted as "UTF-8". If this were the case, converstion
to unicode might be correct. By the way: the HTML specification
says that uploaded files should come with a "content-type" declaration.
In this case, the charset specified there (if any) should be used
to determine the encoding.

-- 
Dieter



More information about the ZPT mailing list