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

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



Patrick Dreyer, SY-UCP writes:
> On working with callbacks take care of situations like that:
> You are doing a search and you need all returned strings to be in 8-byte
> ISO-8859-1 format.
> Following that, you are doing another search over the same connection
> but this time you need all returned strings to be in Unicode format.

If this is because different attribute types have different character
sets, you could configure the charset conversion module so that only
some attributes are converted.  Otherwise, you'd have to do
ldap_set_option() in between the calls to remove the converters.
However, in this case you might prefer to convert the data 'by hand'
outside the LDAP library calls instead.

> Additionally take care, that we should have the possibility to have
> multiple connections doing different string conversions.

Right, the callbacks should be set per connection.
Maybe with globally set callbacks as a default, I don't know how libldap
does that with options.  If so, it would be quicker if the connection
copies the global callbacks when it is created.  Would that be OK?

> But sure is, string conversions "on the fly" would by very nice.

-- 
Hallvard