Emmanuel Dreyfus wrote:
Hello
It would be nice if ldapsearch could display non-ASCII strings in a configurable charset, instead of always encoding in base64.
I understand the current behavior is a requirement for LDIF compliance, but I believe we can add a non-LDIF compliant output, if this is what the user requested.
Attached is a quick patch that will let ldapsearch output in the charset specified by LDAP_CHARSET environment variable (inspiration from LESS_CHARSET for less(1)). That makes life much more confortable when handling non-english data.
It uses iconv() if <iconv.h> is detected. This function has been in POSIX for a while: https://pubs.opengroup.org/onlinepubs/007908775/xsh/iconv.html
Opinions? Thoughts?
It would probably make more sense to just release an LDIFv2 spec, and specify that values are in UTF-8. That would align well with the fact that values in LDAPv3 are UTF-8.
I'm not seeing what benefit iconv brings to the table. We had a test for it in configure for years, but nothing ever used it.