Hi,
I have a function like the following;
QString LoggerManager
::encryptAes(const char* p_Text,
const char* p_key
) {
...
unsigned char* text = new unsigned char((strlen(p_Text) - 1)*sizeof(char));
for(int i=0; i < (strlen(p_Text) - 1); i++)
{
text[i] = p_Text[i];
}
...
qDebug() <<
"TextManip 2: " <<
QString((char*)(text
));
}
QString LoggerManager::encryptAes(const char* p_Text, const char* p_key)
{
...
unsigned char* text = new unsigned char((strlen(p_Text) - 1)*sizeof(char));
for(int i=0; i < (strlen(p_Text) - 1); i++)
{
text[i] = p_Text[i];
}
...
qDebug() << "TextManip 2: " << QString((char*)(text));
}
To copy to clipboard, switch view to plain text mode
p_Text is "ZEROZEROZEROPC010101". But when I want to print it to VS output with qDebug like;
qDebug
() <<
"TextManip 2: " <<
QString((char*)(text
));
qDebug() << "TextManip 2: " << QString((char*)(text));
To copy to clipboard, switch view to plain text mode
the string is printed to output window as;
"ZEROZEROZEROPC010101?????????"
Any ideas?
Regards
Bookmarks