kemp
21st September 2010, 11:53
Hi,
I cannot get the right text into the QString.
QByteArray ba = "abcÄćžšđ ABCČĆŽŠÄ."; //OK
char* cTmp = ba.data(); //OK
QString sTmp1 = "abcÄćžšđ ABCČĆŽŠÄ."; //NOT OK - data = "abc�枚� ABC�Ǝ��."
QString sTmp2 = QObject::trUtf8("abcÄćžšđ ABCČĆŽŠÄ."); //NOT OK - data = "abc�枚� ABC�Ǝ��."
I have also set:
QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
What am I doing wrong?
I cannot get the right text into the QString.
QByteArray ba = "abcÄćžšđ ABCČĆŽŠÄ."; //OK
char* cTmp = ba.data(); //OK
QString sTmp1 = "abcÄćžšđ ABCČĆŽŠÄ."; //NOT OK - data = "abc�枚� ABC�Ǝ��."
QString sTmp2 = QObject::trUtf8("abcÄćžšđ ABCČĆŽŠÄ."); //NOT OK - data = "abc�枚� ABC�Ǝ��."
I have also set:
QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("UTF-8"));
What am I doing wrong?