ich habe eine Ldap-Datenbank und möchte nun Werte mit Umlaute draufschreiben.
Wenn ich dann die Add-Funktion aufrufe wird ein UnicodeEncodeError geworfen.
Code: Alles auswählen
Traceback (most recent call last):
File "D:/Starkstrom/LdapRegistration/registration.py", line 94, in <module>
addUser(attrs)
File "D:/Starkstrom/LdapRegistration/registration.py", line 59, in addUser
cn='cn='+encodeBase64(inputList['vorname'])+' '+encodeBase64(inputList['nachname'])
File "D:/Starkstrom/LdapRegistration/registration.py", line 48, in encodeBase64
return base64.encodestring(string)
File "C:\Python27\lib\base64.py", line 315, in encodestring
pieces.append(binascii.b2a_base64(chunk))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128)
Danke schoneinmal im vorraus.