From: Alain S. <asp...@gm...> - 2007-05-23 22:37:46
|
On 5/23/07, Michael Str=F6der <mi...@st...> 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=3Ddetail&atid=3D352072&aid=3D616567= &group_id=3D2072 > > 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. > --=20 -- Alain Spineux aspineux gmail com May the sources be with you |