I am making my Qt program with C++. I am reading a value from a card Reader but its libraries gives me the value with an unsigned char*. And I needit in Qstring to put it in a QTextEdit.
I have tried:
char* aux(reinterpret_cast<char*>(data->track2));
QString myString = QString::fromUtf8(aux);
I can read my unsigned char like this:
for(int x = 0; x < len; x++){
printf("%02X", buf[x]);
}
But I get very strange values. Anyone can help me? Or how can I push that unsigned char*
(buf) in a string?