ldap_simple_bind_s for non English characters fails with invalid credentials

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
All,
I need some help for ldap_simple_bind_s. We have a scenario,where DN contains Russian characters <br/>

<br/>

UserDN would contain CN=сергей сергей,CN=Users,DC=voice,DC=com
Character set is set to MBCS.
performLDAPLogin(const char *userName,<br/>
<span style="white-space:pre const char *password,<br/>
<span style="white-space:pre const char *userDN)
{
// Ldap connect is done successfully //
char *szData = new char[strlen(userDN)+1];<br/>
<span style="white-space:pre strcpy(szData, userDN); <br/>
<span style="white-space:pre szData[strlen(userDN)] = ;<br/>
<br/>
<span style="white-space:pre char *szPass = new char[strlen(password)+1];<br/>
<span style="white-space:pre strcpy(szPass, password);<br/>
szPass[strlen(password)] = ;
iRtn = ldap_simple_bind_s(ld, szData, szPass);
IRtn always fails with invalid credentials, the same code works fine for English characters.
Do we need to use unicode version of ldap_simple_bind_sW ?
<br/>

Any help or pointers would be of great help.

Thanks,
<br/>

<br/>


View the full article
 
Back
Top