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

<span style="white-space

{
// Ldap connect is done successfully //
char *szData = new char[strlen(userDN)+1];<br/>
<span style="white-space

<span style="white-space

<br/>
<span style="white-space

<span style="white-space

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