Hi,

I've got another problem accessing an openldap server using PHP.

The value of an attribute is encoded using base64 encoding since it contains a non-us character.

PHP seems to decode the base64 attribute to obtain utf8. While it's doing that, it seems to screw up. A character that is supposed to be utf8 11000011 10100010 turns out to be 11000011 01100001 which isn't correct utf-8 at all.

I checked the raw data in the ldap directory using ldapsearch, base64 decoded it with php and received the correct value.

Any hints?

Johannes

    Hi,

    it turns out that the ldap server used t61 encoding instead of utf-8. So a call to ldap_t61_to_8859 solves the problem.

    The server claims to be V3, so it really should use utf-8 encoding...

      Write a Reply...