unicode value

Alain Spineux aspineux at gmail.com
Thu May 24 00:37:42 CEST 2007

On 5/23/07, Michael Ströder <michael at stroeder.com> wrote:
> Alain Spineux wrote:
> > Why does python-ldap not convert automatically any unicode string into
> > UTF-8 before
> > to call the raw function ?
> >
> > Is-it by design or just a lack of time ?
> Kind of a FAQ. Feel free to propose a patch with a good(!) solution.
> https://sourceforge.net/tracker/?func=detail&atid=352072&aid=616567&group_id=2072
> Being the author of a schema-aware LDAP client based on python-ldap I
> know in how many detail problems you can run into...

They are two problems:

- First, encode data when sending request to ldap server.
 Do you know an drawback to encode any unicode sting into utf-8 ?
-Second, decode data coming back from the server.
 The only function to retrieve data is search(), right ?
 what about the use of this kind of request ?
 ldap_con.search_s(base_dn, ldap.SCOPE_BASE, filter, ['cn', 'mail',
u'givenName', u'sn' ])

 that way, python-lib know that attribute givenName and sn should be
decoded into unicode  string.

Do you see any other problems ?

> Ciao, Michael.

Alain Spineux
aspineux gmail com
May the sources be with you

More information about the python-ldap mailing list