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

Re: UTF-8 support for libldap

Julio Sánchez Fernández writes:
> A few weeks ago I took the Umich 3.3 ldap and added translation between
> ISO-8859-1 and UTF-8.  (...)  However, I feel unsure about this patch,
> I am not completely convinced that this is the right approach.

I did something similar some time ago.

I added a -C<charset> option to ldapd some time ago, it supports latin1
and UTF-8.  See <URL:http://www.uio.no/~hbf/ldap-utf8.patch>.

I'd be surprised if it is correct, since it translates *everything* from
T.61 to the specified charset at BER level, regardless of attribute type
or anything.  Not to be used for write operations:-)
Still, it works fine for (non-binary) read access.

> On the one hand, any LDAP client needs to do something about this and
> doing it in the library fixes the problem for every one of them.  On the
> other hand, I don't understand the code very well, so I a not certain
> that I have not broken something needed in the process.

You probably did, same as me.  You don't know if the attribute *should*
be translated to/from T.61 unless you know its syntax.  It could be a
binary attribute, like a certificate.

> In particular, I don't quite understand what use is translating
> from/to T61.

What do you mean?  I assume you don't mean you want to show the user raw