Answer the question
In order to leave comments, you need to log in
Why is base64 encoding different on windows and Linux?
I encode the string via openssl on the Win10 command line and the same string in the CentOs console. The result is different on these OSes. utf-8 encodings. Why is that?
Answer the question
In order to leave comments, you need to log in
direct the output in both cases to files and compare these files (look in a hexadecimal viewer), that's the point.
either the encoding is different, or someone (Windows, I suppose) puts BOM at the beginning of the line, or there is a line break (it is different in different OSes).
The base64 algorithm is single and unambiguous.
If the strings are different, then the input is different strings. It's most likely a coding issue. Check input strings
Here you can decode the string back online and understand which OS the error is on:
https://www.base64decode.org/
Win10 uses 866 encoding by default on the command line.
To configure - read about the chcp command
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question