I'm trying to understand why we would use Base64 to convert binary data to ASCII characters rather than just converting it straight to ASCII. In every calculation of Base64 that I've seen, you either start with ASCII characters, or start with binary data which is converted to ASCII in the process of eventually converting it to Base64.
My question is: Why not just leave it in ASCII, rather than converting it to the Base64 subset?
I've read through all the related questions on Stackoverflow and while I've found lots of useful info, this is the part of the question that I still can't wrap my head around.
I've been trying to encode a twitter embed code into base64 that may or may not contain one or multiple emojis. So when there is an emoji in the string, I get this error:
Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
Is there anything I can do so that when I run btoa() on my string, it encodes the whole string including the emoji, and when I decode it using base64_decode in php, the emoji appears again?
Thanks in advance!
how to convert byte data to a string so I perform base64 decode on it and then zlib decompress it.
data = b'eJzLSM3JyQcABiwCFQ=='
"\xE2" from ASCII-8BIT to UTF-8 also getting
Is it possible for a string generated from a base64 encoding to have a space (' ') in it?
one of my project i need decode the following string (it changes time to time but format is same).
at first glance it seems it is base64 encoded, so i have tried to decode using base64 but it returns garbage.
can any on help please?