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

RE: String conversions UTF8 <-> ISO-8859-1

> -----Original Message-----
> From: Hallvard B Furuseth [mailto:h.b.furuseth@usit.uio.no]

> However, how about keeping charset handling in a separate library, but
> provide it as callbacks from the LDAP library?  Then the entire API
> would be an ldap_set_option() call to set two callbacks.  That is,
> before the LDAP library sends user data to the server, it calls
> something like
>   (*send_callback)(operation, "attribute type", "data")
> and sends the result value instead of the original data.  Similarly,
> it sends data from the server through
>   (*receive_callback)(operation, "attribute type", "data")
> and provides the user with the result instead of the original data.

This sounds interesting. It requires a bit of effort to hunt down all the
places where the callback must be inserted; there are a number of nested API
entry points and such to deal with on the send side.
> Something similar was (or is? I can't find it) in the code once but it
> did not provide enough information to handle schema properly.

It was in liblber. Very much the wrong place for it. It was only in 1.x,
removed in 2.0.

> On the charset handling side, most of it should be
> straightforward, the
> biggest work would be to pick apart filters and put the
> modified filters
> together again.  Maybe code for that can be stolen from back-meta.

Also need to tear apart returned search entries and rebuild them, but that
can also be stolen from back-meta.

I suppose it's worth noting that back-ldap was originally intended to do some
of this on the fly; in particular it was intended to allow V2 clients to use
V3 servers and vice versa. That's why I wrote libldap/t61.c. But as V2 is
deprecated I never bothered to finish that.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support