[Top] [All Lists]

Re: base64 decoding ignore whitespace

1999-05-27 12:55:30
The following discussion happened on the XEmacs development list:

On 27 May 1999 21:38:38 +0200, Hrvoje Niksic <hniksic(_at_)srce(_dot_)hr>  said:
Kyle Jones <kyle_jones(_at_)wonderworks(_dot_)com> writes:

It's required by the MIME spec.  RFC 2045, page 26,

   Any characters outside of the base64 alphabet are to be ignored in
   base64-encoded data.

So this is a very welcome patch.

I added base64 en/decoding without ever reading the specs.  Ain't I
cool?  All out of my clever little head.  :-)  Just kidding...

But that snippet means that we should ignore *anything* outside the
base64 alphabet.  In that case, *every* string would "decode" validly,
even "\0\1\hi!".  Do you think that's a good idea?  If yes, I'll
change the code (it's easy.)

Is Hrvoje's interpretation correct?  Should every string "decode" validly?
If so, should the output of his test string be zero bytes of decoded data?

Should it be doing something else instead?

                                Valdis Kletnieks
                                Computer Systems Senior Engineer
                                Virginia Tech

Attachment: pgpvCirkX6p6E.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>
  • Re: base64 decoding ignore whitespace, Valdis . Kletnieks <=