PHP+ldap results with french accents showing a questionmark

All,

thanks to you I already got the LDAP-queries right, but now there's an issue with the formatting of the results. The queries run perfectly and do return the correct information, however when a name (queried from AD) contains a french accents (and there are quite some of them) the result is shown with a question-mark inside a square instead of the character with the french accent.

I'm wondering, is this due to PHP, javascript or is it maybe the LDAP-query that returns the result with an questionmark?

Your help is appreciated (once again)!

Kind regards,

Michael
LVL 11
MichaelVHAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
MichaelVHConnect With a Mentor Author Commented:
I have found the solutions for my problem.
I had to convert the string (that the query returned) to utf8 using the utf8_encode function.

The other way around utf8_decode did the trick.

Thanks for your help anyway!

Kind regards,

Michael
0
 
leakim971Connect With a Mentor PluritechnicianCommented:
Hello MichaelVH,

+1 for LDAP-query

Regards.

0
 
MichaelVHAuthor Commented:
if you mean that I had to post the query, than here you go:
ldap_search($ctc,"dc=domain,dc=tld","(&(objectcategory=person)(objectclass=user)(cn=*".$_GET['q']."*))") or die ("Error in search query");

regards,

Michael
0
All Courses

From novice to tech pro — start learning today.