Page 1 of 1

Unicode LDAP bind

PostPosted: 10. February 2012 12:38
by SiViN
Hello, sorry for my bad english :(

I have script :

=> it does not work:
Code: Select all
$ad = ldap_connect("server.loc");   
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_REFERRALS, 0);
$login = "user@server.loc";
$password = "Zeměščř1*";
$bd = ldap_bind($ad,$login, $password) or die("Couldn't bind to AD!");


=> if I change my password in the domain to:
$password = "Zemescr1*";
=> this works


I need the first script function.. (Zeměščř1*) -> Unicode solution?
If you use the original Apache on Linux and everything works. Xampp does not work. But I have to use Xampp.

Unfortunately, I do not know about that board :( someone help please?

Re: Unicode LDAP bind

PostPosted: 10. February 2012 21:05
by JonB
Did you save your code with an editor that supports UTF8 encoding???

Re: Unicode LDAP bind

PostPosted: 11. February 2012 03:25
by SiViN
Yes, i used UTF-8 encoding for file. I tested Windows-1250, ISO-8859-2, UTF-8 etc.
I also tried $password = iconv(someInputEnc, someInputDec, .......
Nothing works as well :(

Re: Unicode LDAP bind

PostPosted: 11. February 2012 04:20
by JonB
Check the page header info. (like with firebug)

Re: Unicode LDAP bind

PostPosted: 11. February 2012 19:33
by Altrea
Hi SiViN,

i would use utf8_encode() in $user and $password.
AD v3 uses UTF-8 by default and ldap_bind can work with UTF-8 too.
So something must be missing in your implementation.

Do you close the ldap connection with ldap_close() if no connection can be established and at the end of your ldap functionality? If not, that can cause some difficult to debug errors.

best wishes,
Altrea

Re: Unicode LDAP bind

PostPosted: 15. February 2012 09:42
by SiViN
utf8_encode($user, $password) not helped
Firebug says page header info = UTF8
File is in UTF-8 Encoding..
nothing works :(

Re: Unicode LDAP bind

PostPosted: 15. February 2012 11:45
by JonB
Try posting your question on StackOverflow:

http://stackoverflow.com/

Lots of server experts over there, not just a few like here.

Good Luck
8)