ReneNyffenegger / cpp-base64

base64 encoding and decoding with c++
Other
891 stars 311 forks source link

Test.cpp wrong expected result #28

Closed tomato3107 closed 3 years ago

tomato3107 commented 3 years ago

The first test expects encoded = "UmVuw6kgTnlmZmVuZWdnZXIKaHR0cDovL3d3dy5yZW5lbnlmZmVuZWdnZXIuY2gKcGFzc2lvbiBmb3IgZGF0YQo=". On my Windows this decodes to "René Nyffenegger\nhttp://www.renenyffenegger.ch\npassion for data\n"

Shouldn't the encoded value be "UmVu6SBOeWZmZW5lZ2dlcgpodHRwOi8vd3d3LnJlbmVueWZmZW5lZ2dlci5jaApwYXNzaW9uIGZvciBkYXRhCg=="?

Codepage problem?

All other tests succeed.

ReneNyffenegger commented 3 years ago

Yes, the reason is the encoding with which test.cpp is encoded. Your value is the result for latin-1 while "mine" is the result if the file is encoded in UTF-8.