[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Escaping non-printable characters
Kurt D. Zeilenga wrote:
> At 06:19 AM 3/1/2006, Luke Howard wrote:
>
>>Apologies if this has been brought up before.
>>
>>I think it might be useful to always escape non-printable characters:
>
> I think it's better to have minimal escaping on the wire as
> DNs strings are (too) often presented by UIs as they appear on the
> wire (on Unicode capable devices).
+1!
>>#define LDAP_DN_NEEDESCAPE(c) \
>>- ( LDAP_DN_ESCAPE(c) || LDAP_DN_NE(c) )
>>+ ( LDAP_DN_ESCAPE(c) || LDAP_DN_NE(c) || !LDAP_DN_ASCII_PRINTABLE(c) )
>>
>>It seems to me nicer to see them escaped rather than have the whole
>>DN base64 encoded, when presenting DNs using ldapsearch.
>
> I view this as a separate issue. For LDIF, ldapsearch(1)
> escapes non-ASCII strings as we're not sure the user's terminal/printer
> is UTF-8 capable. It would be good to have a flag that caused
> minimal-escaping LDIF to be produced (for those who do have UTF-8
> capable terminal/printers).
But you could hex-escape DNs in LDIF lines dn: which would make it more
readable in LDIF. But as you said this is a separate issue.
Ciao, Michael.