How to handle special characters in LDAP query

651 views Asked by At

I use ldapsearch on Ubuntu to

  • access an LDAP server
  • create a cache-file from the returned results to lookup addresses, phone-numbers, etc.

To create the cache file I use this command

ldapsearch -h ldap.example.domain -LLL -D cn=***,cn=***,dc=***,dc=*** -W -s one -b cn=***,dc=***,dc=*** "cn=*" sn givenName

works out, for most of the cases, but if I search the cache-file for names, containing umlaut characters (e.g. üöäß), no results are returned.

Reason:

Max Müller

for example is encoded as

Max TcO8bGxlcg==

by the LDAP server and therefore unusable within the cache file. Is there any possibility to resolve this?

Note: I cannot change the results of the LDAP server itself, since I have no root access to it.

1

There are 1 answers

0
jwilleke On

What you are seeing is normal for LDAPSEARCH results. Generally, you should not need to create a cache file as LDAP is very fast. The values you see in the result are base64 encoded.

You could use something like the UnboundID LDAP SDK for Java which has a memory based LDAP server that could run locally.