[python-ldap] GECOS and UTF-8

Michael Ströder michael at stroeder.com
Mon Apr 11 15:27:23 CEST 2011


Ville Törhönen wrote:
> I've created a user management script with python-ldap and I'm having
> difficulties with accented characters such as "ä" or "ö", specifically
> in the GECOS field.
> 
> ldap.INVALID_SYNTAX: {'info': 'gecos: value #0 invalid per syntax',
> 'desc': 'Invalid syntax'}

That's because 'gecos' is declared with LDAP syntax IA5String. I doubt that
you want to populate that anyway.

> Is there a solution for this? At the moment I have to modify the GECOS field
> manually by using Apache Directory Studio.

And does it NON-ASCII chars with Apache Directory Studio?

CIao, Michael.


More information about the python-ldap mailing list