On 12 Oct 2004, at 07:39, Graham Barr wrote:
$ diff LDIF.pm LDIF.pm.saved

oops, sorry. I did not realize you diff was backwards when I wrote that.

Graham.

354c354
<     if ($v =~ /(^[ :<]|[\x00-\x1f\x7f-\xff])/) {
---
if ($v =~ /(^[ :]|[\x00-\x1f\x7f-\xff])/) {

No, the original code is correct. RFC2849 states

value-spec               = ":" (    FILL 0*1(SAFE-STRING) /
                                ":" FILL (BASE64-STRING) /
                                "<" FILL url)

SAFE-INIT-CHAR           = %x01-09 / %x0B-0C / %x0E-1F /
                           %x21-39 / %x3B / %x3D-7F
                           ; any value <= 127 except NUL, LF, CR,
                           ; SPACE, colon (":", ASCII 58 decimal)
                           ; and less-than ("<" , ASCII 60 decimal)

SAFE-STRING              = [SAFE-INIT-CHAR *SAFE-CHAR]

So any value beginning with : or < is not a SAFE-STRING and must be base64 encoded

Graham.





Reply via email to