Version 1 LDIF examples

You can use the optional charset tag so that the utilities automatically convert from the specified character set to UTF-8.

See the following example:
 version: 1
 charset: ISO-8859-1

 dn: cn=Juan Griego, o=University of New Mexico, c=US
 cn: Juan Griego
 sn: Griego
 description:: V2hhdCBhIGNhcmVmdWwgcmVhZGVyIHlvd
 title: Associate Dean
 title: [title in Spanish]
 jpegPhoto: file:///usr/local/photos/jgriego.jpg

In this instance, all values that follow an attribute name and a single colon are translated from the ISO-8859-1 character set to UTF-8. Values following an attribute name and a double colon (such as description:: V2hhdCBhIGNhcm... ) must be base-64 encoded, and are expected to be either binary or UTF-8 character strings. Values that are read from a file, such as the jpegPhoto attribute specified by the web address in the previous example, are also expected to be either binary or UTF-8. No translation from the specified charset to UTF-8 is done on those values.

In this example of an LDIF file without the charset tag, content is expected to be in UTF-8, or base-64 encoded UTF-8, or base-64 encoded binary data:
# IBM Directory sample LDIF file
#
# The suffix "o=sample" should be defined before attempting to load
# this data.

 version: 1

 dn: o=sample
 objectclass: top
 objectclass: organization
 o: sample

 dn: ou=Austin, o=sample
 ou: Austin
 objectclass: organizationalUnit
 seealso: cn=Linda Carlesberg, ou=Austin, o=sample
This same file can be used without the version: 1 header information, as in previous releases of the IBM® Verify Directory version C-Client SDK:
 # IBM Directory sample LDIF file
 #
 # The suffix "o=sample" should be defined before attempting to load
 # this data.

 dn: o=sample
 objectclass: top
 objectclass: organization
 o: sample

 dn: ou=Austin, o=sample
 ou: Austin
 objectclass: organizationalUnit
 seealso: cn=Linda Carlesberg, ou=Austin, o=sample
Note: The textual attribute values can be specified in base-64 format.