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


At 01:20 AM 2001-10-17, Sebastian Dietzold wrote:
>based on this code - snippet from the rfc 1823 (The LDAP Application
>Program Interface).

I assume you are not using an RFC 1823 API.  1823 is LDAPv2
only, LDAPv2 uses T.61 and IA5 for most string encodings,
not UTF-8.  I assume you are using an LDAPv3 API such as
provided by OpenLDAP 2.  Here you might view the IETF
draft (in doc/drafts).

>How can i convert the values to a printf-able format
>like ISO8859-1?

Well, to convert a UTF-8 character in the range U+00000-U+000FF,
one can just convert to UCS-4 store the low order octet in
a char.  OpenLDAP 2.0 does NOT provides conversion routines,
but there are routines available in HEAD.  There are, of course,
number other Unicode libraries which deal with such conversions
as well as transliteration.  I suggest you poke about pages
mentioned in <http://www.openldap.org/faq/index.cgi?file=367>.