[ZPT] Unicode and 8-bit string migration fix

Tino Wildenhain tino at wildenhain.de
Fri Oct 17 03:53:41 EDT 2003


Hi Toby,

Toby Dickenson wrote:
> On Friday 17 October 2003 06:29, Stuart Bishop wrote:
...

> The rule used in dtml for this type of template (that is, ones that mix 
> 'string' and u'string' ) is to convert the plain strings into unicode 
> assuming latin-1, then for the whole template to return a unicode string.
...

The assumption of latin-1 is very dangerous and brings us in a position
similar to the anybody-uses-ascii assumption as it was before.

What if I type utf-8 into the template? This is very common since
it is supported by browsers and lets me input for different languages
without switching encoding.
Could be content-type with the extension charset used for display
and evaluation of the encoding?

Regards
Tino




More information about the ZPT mailing list