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

Chinese problem in the ldif files.



Hi,

These days i want to add some entries to the local LDAP server.
And there were some chinese words in the *.ldif files.

this is an example of ldif files:

dn: uid=zhangweiwu,ou=People,dc=hartt,dc=realss
uidnumber: 1
uid: zhangweiwu
phpgwcontacttypeid: n
phpgwcontactowner: 9
phpgwcontactaccess: public
cn: zhangweiwu
sn: zhangweiwu
phpgwmiddlename: ??
phpgwaddresslabel: ??????
telephonenumber: 0592-8853433
phpgwmailtype: INTERNET
phpgwmailhometype: INTERNET
phpgwContactCatId: 1
objectClass: person
objectClass: organizationalPerson
objectClass: phpgwContact

and it can be added successfully.but cannot display proper Chinese in ldap client ,it will display lots of "?????".

And if i exported it from the LDAP server,the Chinese are coded in base64.

And here is what i exported:

dn: uid=zhangweiwu, ou=People, dc=hartt,dc=realss
phpgwAddressLabel:: 5bCP6ZmI5piv5Liq5aW95Lq6
telephoneNumber: 0592-8853433
sn: zhangweiwu
uidNumber: 1
phpgwMailHomeType: INTERNET
objectClass: person
objectClass: organizationalPerson
objectClass: phpgwContact
phpgwContactOwner: 9
uid: zhangweiwu
phpgwContactTypeId: n
phpgwMailType: INTERNET
phpgwMiddlename:: 5bCP6ZmI
cn: zhangweiwu
phpgwContactCatId: 1
phpgwContactAccess: public

And if i encoded the chinese words to base64 manually.
it wasn't 5bCP6ZmI5piv5Liq5aW95Lq6
it was 5oiR5bCG57un57ut5YiG5p6Q5a6D55qE5YaF5qC4Cg==

and i encoded the "5bCP6ZmI5piv5Liq5aW95Lq6" to normal ,and it cannot
display properly until i tried all the charsets.

I want to know how the encoding and decoding works when the data input /output the LDAP servers.
And wheather or not it have some problems in dealing with chinese words?


My server is OpenLDAP 2.1.26 on gentoo linux.