--On Freitag, 6. Mai 2005 19:40 Uhr +0200 Jürgen Herrmann <[EMAIL PROTECTED]> wrote:

i have set my python default encoding to utf-8, i always send http responses from zope as utf-8

My personal point on changing the default encoding of Python: don't do it (other people
will see this different). As long as you are dealing with really only *one* encoding it
might be ok. As soon as you mix different encoding (which happens easily with utf8 and
iso-8859-X) you are doomed at some point within your application because you will never know
why it some string with some encoding converted to whatever. My strategy if you need unicode:
keep the default encoding as it is (ascii) and convert everything internally to Python unicode
string - not to utf8 encoded string. Perform every operation internally using unicode strings.
Only convert to utf8 on the presentation level (means when you send data back to the client
or export data to the filesystem or whatever). Such a clean separation between internal Unicode
representation and external representation saves you a lot of trouble.


Attachment: pgpef3FW1knbO.pgp
Description: PGP signature

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to