Open FredyH opened 6 years ago
so it adds newlines because of some historic use of e-mail or something, and most parsers should cope with that. i could see it messing up if appended to URLs or something, might be best to remove it.
will look in to the empty string stuff though
I'd say that almost all (if not all) parsers can definitely deal with it if it does not contain any newlines. The problem arises when you want to base64 encode something so that you can use it in URLs or similar, where newlines obviously break things.
so it adds newlines because of some historic use of e-mail or something, and most parsers should cope with that. i could see it messing up if appended to URLs or something, might be best to remove it.
will look in to the empty string stuff though
I have to gsub out the newlines to make the encoded uris work with chromium.
Details
util.Base64Encode places a newline after a specific number of characters and also returns nil when you provide an empty string. For comparison, this is what the same (correct!) function in JS does:
Steps to reproduce
Just run the function.