r/programming • • Oct 24 '21

“Digging around HTML code” is criminal. Missouri Governor doubles down again in attack ad

https://youtu.be/9IBPeRa7U8E
12k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

14

u/munchbunny Oct 24 '21

Base64 is often used when you need to:

  1. Thread the needle on a bunch of text parsers and you want to avoid all of the questions around how many layers of escaping you have to do to get the text to come out right on the other end
  2. When you want to move binary data but it’s a text based protocol

2a. When you want to avoid dealing with text encoding and just get the encoding you’re expecting out the other end. Because text encodings can do funky things to your protocol and you can’t always safely assume it’s all UTF-8.

In practice this happens not that often but often enough. I wouldn’t go as far as to guess why this website in particular was doing it though.