[Zope] Dealing with non-ASCII strings?

Jean Jordaan jean@upfrontsystems.co.za
Wed, 02 Oct 2002 10:57:00 +0200


Hi Toby

> guessing is your only option if you cant ask the person who supplied 
> you with your data.

Yup, thought as much.

> unicode_string = unicode(encoded_8bit_string, 'data character encoding')

Yes. The bit we were missing in our app was this: our LDAP connection
didn't want unicode_string (which looks like, say, u'string\xNN'), but
it's fine with unicode_string.encode('utf-8') (which looks like, say,
'string\xc3\xNN').

> Overall I think the 2.6 upgrade will be less pain)

We probably will do that.

-- 
Jean Jordaan
Upfront Systems                         http://www.upfrontsystems.co.za