From: Ingo S. <st...@un...> - 2005-05-03 07:41:42
|
Am Montag, 2. Mai 2005 20:22 schrieb Michael Str=F6der: > Ingo Steuwer wrote: > > modlist=3D[(ldap.MOD_REPLACE,"description",[u"hall=F6le".encode('ISO-88= 59-1') > >])] lo.modify_s("CN=3Dmoreusers,CN=3DUsers,%s"%ldap_base,modlist) > > LDAPv3 mandates use of Unicode with UTF-8 encoding. You are accessing > Active Directory via its LDAPv3 interface. Hence it expects UTF-8. > > > It is documented that Active Directory uses ISO-8859-1 and not utf8 (li= ke > > Openldap an others). > > I doubt that. Well, depends on what "Active Directory uses ISO-8859-1" > really means... This was mentioned in a documentation of a python-ldap-based tool a can't f= ind=20 anymore... google stuff. > But the charset of the internal storage of AD is not relevant when > accessing it through LDAPv3. > > > So, is this a python-ldap or openldap-problem > > Nope. The applications using python-ldap are responsible to provide the > proper charset and encoding at the API level. > [..] > > I've tried it. It works for me with UTF-8. Just to be sure: You tried it which way? My experiences are that python-lda= p=20 doesn't allow the use of unicode in a modlist (see Exception in my first=20 mail, "expected a string in the list"). Which python-version do you use? =46urthermore it seems to me that python-ldap does not use unicode internal= y. If=20 I read from AD I get unicode strings which are handled by python like Latin= =20 =2D- which means I have to convert them like "unicode(value,'utf8')". I=20 expected that modlist will need also unicode as normal strings but that wil= l=20 give me the other conversion-exception ("ordinal not in range(128)"). Regards Ingo Steuwer > Ciao, Michael. =2D-=20 Ingo Steuwer st...@un... fon: +49 421 22 232- 0 Entwicklung Linux for Your Business Univention GmbH http://www.univention.de/ fax: +49 421 22 232-99 |