From: Chris R. <chr...@me...> - 2001-03-08 09:49:17
|
Graham Barr <gb...@po...> wrote: > I don't think the DN should be base64 encoded, it should be encoded > using rules from rfc2253, which should result in a printable string > and avoid the need for base64 encoding Interesting. RFC 2849 says that DNs should be base-64 encoded if any of the RDN values contain 'unsafe' characters. RFC 2253 format DNs 'may' escape any character using the \hexpair notation. So what you're suggesting is that we display DNs by always backslashifying unsafe characters instead of base-64 encoding them. I think that RFC 2849 would permit that, and it does have the benefit of making the DNs semi-readable. Well, more readable than a blob of base 64. So we need an extra bit of code to backslashify a DN. my $dn = $entry->dn; $dn =~ s/([\x00-\x1f:<\x7f-\xff])/sprintf("\\%02x",ord($1))/ge; (NB colon and < are special in LDIF, hence the additions in the regex.) Cheers, Chris |