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

Re: DNs (Was: namedref updates)

At 03:17 PM 2001-10-26, Pierangelo Masarati wrote:
>> The only place you need to check for non-UTF8 (or
>> non ASCII for LDAPv2) octet sequences in generating a
>> (textual) string representation of the DN.
>Sorry, this sentence is obscure to me. If I understand it
>right, you say that I need to check in ldap_dn2str, not
>in ldap_str2dn;

Exactly. dn2str needs to check the ava_string to
see what escaping is needed based upon the desired
output format.  str2dn just need to unescape whatever
is escaped in the input format.

>but I'm doing it here because I want 
>to know in advance if the value can be represented.
>Sounds like an optimization attempt, though I'm not really
>sure of what I'm saving. If it is a problem I can move the 
>check to ldap_dn2str.

But the presence of an escape does not necessarily
mean the value needs to be escaped.  That is, the
fact that a dnstr <CN=\5A> was escaped does not
imply that string representation of ava_value
(0x5A) needs to be escaped or cannot be represented
in the desired format.