[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: International characters (OpenLDAP v2.0, PHP 4)



Hi Turbo,

On Sunday 08 June 2003 12:52, Turbo Fredriksson wrote:
> I'm trying to improve phpQLAdmin to allow international characters
> in RDN.

International characters can occur in the rest of the DN too, can't they ?

>
> If I don't base64 encode the RDN, but only the 'o' attribute 'INSIDE'
> the object like this, it works. Sort of. I can't SEARCH for the object.
>
> ----- s n i p ----
> dn: o=åäö,o=Turbo Fredriksson
> o: 5eT2
> objectClass: organization
> objectClass: phpQLAdminBranch
> ----- s n i p ----

You need to convert the international characters to UTF8.
Since UTF8 does not change ASCII variables, it is no problem 
to convert the whole DN (and all attributes) when saving them
and decode it back when retrieving them.
Of course the filter in a search has to be UTF8 encoded too ;-)

To me your input looks like (in HTML): o=âäö....
These seem to be the unencoded ISO8859-1 characters.
Encoded in UTF8 these three characters look like: åäö
(which is 0xC3 0xA5 0xC3 0xA4 0xC3 0xB6 in hex).

You do not need to Base64-encode the values except if you want 
to manually write LDIF files.

-- 
Peter Marschall     |   eMail: peter.marschall@adpm.de
Scheffelstraße 15   |   Tel:   +49 931 14721
D-97072 Würzburg    |
PGP: 0BB1 04A3 0FB0 E27F 8018 52BA A286 7B23 9C22 2C83