[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Characters non-ascii

Jon Roberts:
> Isabel Falantes wrote:
> > Hi everybody!
> >
> > I need to load a ldif file that contains characters not ascii in the ldap,
> >but the command ldapmodify doesn't allow it. How I can do it?
> >
> > Thanks in advance.
> >
> > -- Isa.
> >
> I'm currently investigating this, too. From what I've gathered, you need 
> to convert the character data to base64. There are tools and libraries 
> available to do this, but I haven't tried any yet. I'll probably start 
> with the MIME::Base64 perl module. If anybody knows of some better 
> tools, let us know.
> Then, when you add the data via ldif, you need to use the double colon 
> convention, like:
> cn:: IGJlZ2lucyB3aXRoIGEgc3BhY2U=

Or even write a small pythonscript to do your stuff:
I'm using the python-ldap module myself.

Using the python-ldap module and encoding everything with utf8 
before doing ldapmodify give you the advantage of not have to deal with
base64 and double colon convention as described above.

Or you can do it in perl if you prefer it.

I'm using ldapadd and ldapmodify from python-ldap and only utf8
everything I put into the ldap-entrys. You only need Base64 if you have
to first write to a file, and then running the console-tools ldapadd or


Bjørn Ove Grøtan

"SELECT 2 + 2, pi(), 'PostgreSQL is more than a calculator!';"