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

Loading in Base64 encoded data

Hi there,

I installed 2.0.8 and it runs just fine with 30,000+ entries, however I have a 
small problem with adding LDIF data containing Base64 encoding.

Here's one of the records that it choked on (the comment shows the real data):

# dn: cn=Joaquin José, o=xxxx.org
dn:: Y249Sm9hcXVpbiBKb3PpLCBvdT11biwgbz11bmRvdC5vcmc=
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn:: Sm9hcXVpbiBKb3Pp
sn:: Sm9z6Q==
givenname: Joaquin

As you can see, the SN entry contains an accented character, which I have 
therefore encoded with Base64 (using Perl's encode_base64 from the MIME::Base64 

When attempting to load this record, I get the following error:

ldap_initialize( <DEFAULT> )
add objectclass:
add cn:
        NOT ASCII (12 bytes)
add sn:
        NOT ASCII (4 bytes)
add givenname:
adding new entry "cn=Joaquin José, o=xxxx.org"
ldap_add: Invalid syntax
        additional info: cn: value #0 contains invalid data

Now, I can see that the encoding is working, because ldapadd correctly decodes 
the character in the DN, and recognizes that the CN and SN are NOT ASCII -- but 
why does it choke over the value #0?  Is this because I have to both convert to 
Unicode AND Base64 encode the accented characters?

Thanks in advance for advice/suggestions.

Paul Gillingwater

        Paul Gillingwater
        Managing Director
 CSO Lanifex Unternehmensberatung 
 & Softwareentwicklung G.m.b.H.

E-mail:  paul@lanifex.com
Mobile:  +43/699/1922 3085
Webhome: http://www.lanifex.com
Address: Praterstrasse 60/1/2 
         A-1020 Vienna, Austria