I finally found the solution to the problem. After I set the LDAP_OPT_PROTOCOL_VERSION to v3 using ldap_set_option the resulting characters were encoded in UTF-8. D'Oh! It seems that AD makes a difference here when other servers assume v3 to be the standard.
I hope to be helping someone with a similar problem to avoid this confusion!
Regards, Khaled
2011/11/25 Khaled Blah khaled.blah@googlemail.com:
Thanks for your reply, Michael!
I should have mentioned that I have tested this code with an OpenLDAP server (2.4.23) and a Lotus Notes server (ver. 8) and both of them return UTF-8 encoded data (like I expected it). The only difference are the parameters which I use to start the query on these backends (bind DN, filter, etc...).
Regards, Khaled