[Zope] Dealing with non-ASCII strings?

Andreas Jung andreas@andreas-jung.com
Wed, 02 Oct 2002 10:13:34 +0200


--On Mittwoch, 2. Oktober 2002 10:06 +0200 Jean Jordaan 
<jean@upfrontsystems.co.za> wrote:

> Hi there
>
> In the data that we have to work with, there are names in French,
> Turkish, German, Greek, etc. A sample string, when printed from Python,
> is: 'Rabia-r\xddza Bi\xe7en \xf6grenci Yurdu.G\xf6r\xfckle'
> We'd like to store this data in LDAP and in Zope.
>
> Questions:
>
>   - How do we find out what the current encoding of the strings are?
>

Most European languages can be encoded using iso-8859-1, greek is
iso-8859-7.
>
>   - Say we decide it's Latin-7. How do we convert from the current
>     string to Unicode, taking into account the fact that the source is
>     taken to be Latin-7?

Read the Python documentation, e.g. unicode_str = unicode('....', 
'iso-8859-8')

>
>   - Do we need to move to Zope 2.6 in order to cope with such strings?

Maybe...depends on what the usage of unicode inside Zope.

-aj