EDN Admin
Well-known member
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-spacere const char *password,<br/>
<span style="white-spacere const char *userDN)
{
// Ldap connect is done successfully //
char *szData = new char[strlen(userDN)+1];<br/>
<span style="white-spacere strcpy(szData, userDN); <br/>
<span style="white-spacere szData[strlen(userDN)] = ;<br/>
<br/>
<span style="white-spacere char *szPass = new char[strlen(password)+1];<br/>
<span style="white-spacere 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
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-spacere const char *password,<br/>
<span style="white-spacere const char *userDN)
{
// Ldap connect is done successfully //
char *szData = new char[strlen(userDN)+1];<br/>
<span style="white-spacere strcpy(szData, userDN); <br/>
<span style="white-spacere szData[strlen(userDN)] = ;<br/>
<br/>
<span style="white-spacere char *szPass = new char[strlen(password)+1];<br/>
<span style="white-spacere 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