[z3-five] unicodes and strings in Zope 2.9's ZPT with Zope 3's i18n

Roman Susi rnd at onego.ru
Mon Jul 24 07:48:11 CEST 2006


Maciej Wisniowski wrote:
>>Well, I actually buckled and put a sitecustomize.py on the python path 
>>that chanded the default codec from ascii to utf-8.
>>
>> 
>>
> 
> Is this possible to see that code? I'm very interested in it :)

I know people sometimes do it, but it makes code unportable and could
cause other subtle problems.

> 
> And in general why is unicode object better than
> utf-8 encoded string?

Unicode object is more preferable because it is easier to process (that
is, you you do not just store text but apply regular expressions,
searches, calculate lengths, etc.). Of course, usual 1-byte encoding is
even more simpler to use but it is not suitable on international scale.

So, utf-8 encoded strings are convenient only as Unicode serialization:
 when sending Unicode over network, when storing in byte-oriented layers
(like Unicode-unaware database or XML file).

Unicode is more fun also.

Regards,
Roman




More information about the z3-five mailing list