abhinav_oct30
1st March 2017, 03:44
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.
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.