Internationalization patch, i18n, iconv, ...

Michael Ströder michael at stroeder.com
Wed Oct 17 09:56:52 CEST 2001


js9s at netscape.net wrote:
> 
> The iconv is part of glibc 2.2.2 and above, so iconv.h should be in
> any recent LINUX system

web2ldap based on python-ldap aims to run on Win32 platform too...

Anyway all character set translation should be based on Unicode
support introduced in Python 1.6 because the codec concept looks
very clean. There are Unicode codecs for Python based on iconv lib
if the built-in Python codecs are not sufficient.

> I did try to use PyString_(De/En)code, but it is not very well
> suited to openldap type of applications, especially if dn has mixed
> ascii and utf8 encodings.

I'm not sure what you mean with "mixed ascii and utf8 encodings".

UTF-8 is a variable length encoding of the ISO-10646 character set
which maps the page containing the ASCII characters directly to
ASCII.

Example with my last name:

>>> unicode('Ströder','iso-8859-1').encode('utf-8')
'Str\xc3\xb6der'

Ciao, Michael.




More information about the python-ldap mailing list