Re: non-ASCII output for ldapsearch [PATCH]
Howard Chu <[email protected]> Fri, 27 Feb 2026 17:54:35 +0000
| Newsgroups | gmane.network.openldap.devel |
|---|---|
| Message-ID | <[email protected]> |
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. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/