|
Hi John,
The purpose behind base64 is to allow binary data to be sent through a
text transfer medium. For example, if you have a JPEG picture and want
to send it through e-mail, you have a problem. Pictures aren't made up
of letters and numbers, instead the actual bit values of the bytes
control what the picture looks like. However, e-mail was designed for
text. If you send e-mail from a computer running ASCII to a computer
running EBCDIC, all of the bytes in the message will be translated from
ASCII to EBCDIC -- so a picture would become a corrupt mess.
Base64 is a solution to that problem. Base64 takes the actual bit
values that make up a string of data, and converts them to to a
text-safe format. The text can then be translated to
ASCII/EBCDIC/Unicode, whatever, it doesn't matter. When it's decoded,
the data will be decoded back to the exact same binary values that you
started with.
That being the case, a text string encoded on an EBCDIC platform will
CERTAINLY encode to a different string than a text string encoded on an
ASCII platform! Of course it will, since the underlying bit values are
different.
If you take the string 'Hello' and encode it on an EBCDIC platform,
you've encoded x'C885939396' into base64. When you decode it on an
ASCII platform, it'll decode to x'C885939396' -- which is NOT the word
Hello in ASCII (If it did that, there'd be no point to base64) but
rather, it's the exact same bit values you started with...
Hope you understand.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.