0

Let's say I want to run a query like:

ldaps://ldap.company.com/CN=Richards\, Renée,OU=Blah,DC=company,DC=com?field1,field2,field3?sub?(&(objectClass=user))

I found that I had to percent-encode the é using Windows-1252 encoding table ( %e9 rather than %C3%A9). Otherwise, I would get "No such object".

But now I need to query a DN that has a special character that doesn't exist in Windows-1252.

ldaps://ldap.company.com/CN=Richards\, Jūra,OU=Blah,DC=company,DC=com?field1,field2,field3?sub?(&(objectClass=user))

How do I encode the ū?

Jason Wood
  • 351
  • 1
  • 5
  • 13
  • ADVISE: You should rename the entry to use only url safe characters. These type of issues will continue to cause problems with other applications. – jwilleke Sep 01 '20 at 09:06
  • Agreed but I am smaller than the smallest cog in a huge organization. The directory is too big to get all the users even when broken down by OU, so I need to traverse the reporting hierarchy to make sure I get everyone. – Jason Wood Sep 01 '20 at 13:18
  • LDAPv3 added Internationalization through the use of Unicode (UTF-8) (All modern servers are v3) so the encoding should be performed using Unicode and not Windows-1252 – jwilleke Sep 01 '20 at 17:03
  • Tried that (see original question). Strangely it has no problem returning unicode characters in attributes but will not accept unicode encodings in the request. I was hoping it was something on my end and some flag needs to be set in cURL... – Jason Wood Sep 01 '20 at 20:55

1 Answers1

0

The encodings may be dependent on the LDAP SDK used.

Here is what worked for me:

  • CN=Richards, Renée - CN=Richards,%20Ren%C3%A9e
  • CN=Richards, Jūra - CN=Richards,%20J%C5%ABra
jwilleke
  • 10,467
  • 1
  • 30
  • 51