Alex Rivera | Logout

Is a space possible in a base64 encoding?

Asked 2011-02-24T21:32:20.033
24

Is it possible for a string generated from a base64 encoding to have a space (' ') in it?

Edit
Report

3 Answers

31

No. Next question?

http://en.wikipedia.org/wiki/Base64#Variants_summary_table

Actually, spaces and CRLFs are usually silently skipped during the decoding, as they might appear as a result of splitting long strings.

answered 2011-02-24T21:35:05.077
11

By reading the http://en.wikipedia.org/wiki/Base64 wiki it seems that in Base64 transfer encoding for MIME (RFC 2045) spaces are allowed and discarded. In all other variants they are forbidden. Ah... and this question is a duplicate: Can a base64 encoded string contain whitespace?

answered 2011-02-24T21:36:59.133
3

Base64 encoding output will never include a space. FooBabel has a nice (free) online encoding tool based on Apache Codec, where you can play with options like linebreaks and line terminators - foobabel base64 codec

answered 2011-03-02T06:20:58.403

Your Answer