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

Re: Loading in Base64 encoded data



paul,

anything that is not ASCII should be UTF-8 encoded before you send it to any
2.x-version OpenLDAP server. the problem you have is not the
base64-encoding, it's non-ascii characters.

once you encode those you should be fine.

jens


On 5/14/01 8:28, "Paul Gillingwater" <paul@lanifex.com> wrote:

> 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 
> module.)
> 
> When attempting to load this record, I get the following error:
> 
> ldap_initialize( <DEFAULT> )
> add objectclass:
>       top
>       person
>       organizationalPerson
>       inetOrgPerson
> add cn:
>       NOT ASCII (12 bytes)
> add sn:
>       NOT ASCII (4 bytes)
> add givenname:
>       Joaquin
> 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.
> 
> cheers
> Paul Gillingwater
> 
> 
> 
> 
> 
> *********************************
>       Paul Gillingwater
>       Managing Director
> CSO Lanifex Unternehmensberatung
> & Softwareentwicklung G.m.b.H.
>     NEW BUSINESS CONCEPTS
> 
> E-mail:  paul@lanifex.com
> Mobile:  +43/699/1922 3085
> Webhome: http://www.lanifex.com
> Address: Praterstrasse 60/1/2
>        A-1020 Vienna, Austria
> *********************************
>