difficulties with decoding base64 encoded string/QbyteArray???

hej,
So I am new in this Forum and even new in c++ in general.
Well based on my "plain" C knowledge I tried to get used to C++ and QT at once!

So there is my problem:

I do have a string (could also be a QByteArray). The content of that string is base64 encoded!
Now I want to decode this string!

well at first I tried to use:

 
string my_test_string = base64_decode("AQADABIFIgARAKkAJ0a80BABABQyMDE0LTAxLTE0VDEwOjAwOjAwWgIACi0wLjA0MTg0MjUDAAcxLjAwMzc0BAAJLTAuOTIwNjczBQAHMTEuMzU0MgYABzQ0Ni4zNTEHAAcxMTQuMjIxCAAHNjcuODU5NwkABzg1LjE4ODUKAAc5OS43NTQ1CwAJLTAuMTUzMDYzDAABMA0AATAOAAEwDwALLTAuMDA1MTA3NTYQAAktMC4wNTc3MjQ=");

this function is include by base64.h
part of standard c++ lib I guess?

this doesn't work well "my_test_string" only contains two spaces or so?

then I tried a QT method for QByteArray class!
 
QByteArray qbaSBDdataArray_decoded = QByteArray::fromBase64("AQADABIFIgARAKkAJ0a80BABABQyMDE0LTAxLTE0VDEwOjAwOjAwWgIACi0wLjA0MTg0MjUDAAcxLjAwMzc0BAAJLTAuOTIwNjczBQAHMTEuMzU0MgYABzQ0Ni4zNTEHAAcxMTQuMjIxCAAHNjcuODU5NwkABzg1LjE4ODUKAAc5OS43NTQ1CwAJLTAuMTUzMDYzDAABMA0AATAOAAEwDwALLTAuMDA1MTA3NTYQAAktMC4wNTc3MjQ=");


same problem as before: no proper output only two spaces or so?


Well I checked if this function works properly (in general) so tried to convert another string "UXQgaXMgZ3JlYXQh" this is decoded >>returns "Qt is great!<<

another fact to be mentioned is that if I try to decode the "long string" using e.g. the following "web applet" works properly. (http://www.base64encode.org/)
The content, some measurement data and so on can be read properly???

Is there maybe a problem with encoding... UTF-8, ASCII or Windows-1252 ... ?

Topic archived. No new replies allowed.