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

RE: Japanese DN



With or Without encoding, slapadd says:
slapadd: could not parse entry (line=12)

Without encoding, ldapadd complains:
ldapadd: invalid format (line 1) entry: ""


> Hi Folks,
>
> I'm using openldap 2.1.17.
> At first, I exported contacts from Outlook 2000 to a csv file.
> and  now I'm trying to import into the Openldap server.
> Several of the contacts have  in Japanese characters(shift-jis).
> So, I did a little perl script to encode those characters to utf8 and
> base64 in sequence and made
> this ldif sample:
>
> dn:: Y249g2WDWINngsWCtyCCsYLqgs0sb3U9U2hhY2hvdSwgbz1vYWtsYXduLGM9SlA=
> ou: Shachou
> cn:: g2WDWINngsWCtyCCsYLqgs0=
> objectClass: top
> objectClass: person
> objectClass: organizationalPerson
> objectClass: inetOrgPerson
> objectClass: officePerson
> givenname:: g2WDWINngsWCtw==
> sn:: g2WDWINngsWCtw==
> mail: xxxx@xxxxx.jp
> Comment:: iKSSbYynkqE=
>
> When trying to:
> ldapadd -c -D "cn=manager, o=oaklawn, c=JP" -w secret  -f test.ldif
>
> I receive:
> adding new entry "cn=テストです これは,ou=Shachou,
> o=oaklawn,c=JP" ldapadd: update failed: cn=テストです
> これは,ou=Shachou, o=oaklawn,c=JP ldap_add: Invalid DN syntax (34)
>         additional info: invalid DN
>
> I used code to convert the attribute's values:
>      Jcode::convert($val,'utf8');
>      $val = encode_base64($val);
>

Have you tried adding it without converting it, using slapadd instead of
ldapadd?  My experience was that it would automatically get encoded by the
OpenLDAP libraries... But I didn't have any DN's that had high-bit
characters.