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

Use Chinese in Openldap



Hi,all

    I am currently using openldap 2.0.23 in my Redhat 7.3 box.
I want to input a Chinese string to ldap , so I write a Chinese word 
"测试"in file test, then use the command following to encode it to
base64

#uuencode -m test  test1
uuencode -m test test1
begin-base64 644 test1
suLK1Ao=
====

I cut  " suLK1Ao=" and paste into my ldif file as below

# cat  newentry.ldif
dn: cn=test,dc=foobar,dc=com
cn:: suLK1Ao=
sn:: suLK1Ao=
objectclass: top
objectclass: person

then use ldapadd to import to ldap

#ldapadd -x -D "cn=admin,dc=foobar,dc=com" -w secret -f newentry.ldif
adding new entry "cn=test,dc=foobar,dc=com"
ldap_add: Invalid syntax
        additional info: cn: value #0 invalid per syntax

ldif_record() = 21

but if the string is encode from Japanese , all works OK. 
For example, replace the string in newentry.ldif from "suLK1Ao=" to 
"44G+44Gk44GX44Gf". ( The string is copy from some article from here)
and I also test a base64 encoded English string, it works well.
So , it seems that it is the base64 encode wrong?  
Anybody can help me?

Thanks.

Caoweihai