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

Re: conversion of openldap 1.x ldif to 2.1



Hi,

On Sunday 16 February 2003 02:26, Markus Krogemann wrote:
> ok, i read a lot in the archives now. what i still don't get is: how do
> i transfer the T.61(?) encoded 1.x data transferred into a valid 2.1x
> ldif. this problem (ok, task) must have been mentioned before, would
> anyone be nice enough to point me into the right direction?

I do not know the format of 1.x LDIF files, but for 2.x you need to encode
values correctly:
It is a two step process:
1) Ususally you have to encode the values that contain non-ASCII characters
from the local character set into UTF8. That's what the LDAP server wants.
2) To be able to feed those values to the LDAP server with LDIF, you have
to Base64-encode all non-pure-ASCII strings. This is the transfer encoding
used by LDIF. To indicate which attributes are Base64-encoded, 
you have to use double colons (::) instead of single ones between the
attribute name and the value.

Example:
Unencoded (illegal in LDAP !!!)
	greetings: Grüße
LDAP encoded (UTF8):
	greetings: GrüÃe
LDIF encoded (UTF8+Base64)
	greetings:: R3LDvMOfZQo=

To do the 1.x decoding you may try this procedure in the reversed
order and check the results after each step.

To do the conversion programmatically, Perl provides lots of Modules
such as Net::LDAP, Unicode::Map8, MIME::Base64

Peter
-- 
Peter Marschall     |   eMail: peter.marschall@mayn.de
Scheffelstraße 15   |          peter.marschall@adpm.de
D-97072 Würzburg    |   Tel:   +49 931 14721
PGP: 0BB1 04A3 0FB0 E27F 8018 52BA A286 7B23 9C22 2C83