[SOLVED] UTF-8 and special character decoding
-
Hello,
I am getting crazy...I tried a lot of suggestions from internet without success!
I have a string, coming from internet and when I print out it, i have this:
@
qDebug()<< "received UTF-8 text: " << QString::fromUtf8(text);
@Output of above instruction is:
received UTF-8 text: Test \u003c \u003ethis escape characters are html tags ( < > )
all my file are UTF-8 (set from within QtCreator) this problem is in a .cpp file, even though qlm TextEdit is not able to manage it and show correct string!
Someone knows how to resolve this problem?
-
What is text variable in the snippet? Is it a QByteArray, char* or another QString?
-
I would try with QString::fromUtf16() and QString::fromRawData(). Maybe one of them would work.
-
Great, thank you for sharing!