QString Utf8 and latin1 difference
Unsolved
General and Desktop
-
Hi,
I am using QT-5.
I have used the below code:
QString str1= QString::fromLatin1("abc÷ßàéöø");
QString str= QString::fromUtf8("abc÷ßàéöø");
if (str1==str)
ui->textEdit_2->setText("true");
else
ui->textEdit_2->setText("false");This always results in false.
Why is it like this?
Internally QString should be in same format,its character pointer which have different format,for which we use fromLatin1 or fromUtf8. -
Does this mean that latin1 and utf8 strings which are converted from character pointers won't be same if it's having extended acsii characters?