Re: Convert Active Directory Object to string

2006-01-19 Thread Michael Ströder
Dirk Hagemann wrote: What I want to do in the end is the following: I get some data from Active Directory, then I create a SQL-statement including this data and write this into the database. Which API and protocol are you using to access Active Directory? If you access it via LDAP (e.g.

Re: Convert Active Directory Object to string

2006-01-18 Thread Dirk Hagemann
Hi Fredrik! I think this will help me. I just have to do the same for danish encoding and may be some further encondings... Thanks! Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert Active Directory Object to string

2006-01-18 Thread Dirk Hagemann
Ok - this really works well for german special characters, but what to do with all the other encodings. What I could do is to try to vonvert it to latin-1 and if it fails I try latin-2 and so on. But is this really necessary? Isn't there may me a module which can do this for me and returns a

Re: Convert Active Directory Object to string

2006-01-17 Thread Fredrik Lundh
Dirk Hagemann wrote: When I receive data from Microsoft Active Directory it is an ad_object and has the type unicode. When I try to convert it to a string I get this error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 26: ordinal not in range(128) This is

Convert Active Directory Object to string

2006-01-17 Thread Dirk Hagemann
Hi! When I receive data from Microsoft Active Directory it is an ad_object and has the type unicode. When I try to convert it to a string I get this error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 26: ordinal not in range(128) This is caused by characters like