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

Re: Chinese problem in the ldif files.

Dieter Kluenter wrote:


Wang Penghui <wangpenghui@realss.com> writes:


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:

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 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.

You have to encode your chinese to UTF-8 not base64. /usr/bin/iconv -l will give you all known languages and iconv -f BIG-5 -t utf-8 -o utf-8-output.ldif big-5-input.ldif will convert your ldif file.

But my ldif files were already encoded with utf-8