if i use,
QString s
= qr.
value(0).
toString();
res = s;
QString s = qr.value(0).toString();
res = s;
To copy to clipboard, switch view to plain text mode
the result for "SÃO GREGÓRIO" is "SÃO GREGÓRIO"
if i use,
QString s
= qr.
value(0).
toString();
res
= QString::fromUtf8((const char*)s.
data(), s.
length());
QString s = qr.value(0).toString();
res = QString::fromUtf8((const char*)s.data(), s.length());
To copy to clipboard, switch view to plain text mode
the result for "SÃO GREGÓRIO" is "S" and 2 unprintable characters
in any of this two examples it does not work for lowercase characters.
if i use:
QString s
= qr.
value(0).
toString();
string r = s.toStdString();
res
= QString::fromUtf8((const char*)r.
data(), r.
length());
QString s = qr.value(0).toString();
string r = s.toStdString();
res = QString::fromUtf8((const char*)r.data(), r.length());
To copy to clipboard, switch view to plain text mode
the result for "SÃO GREGÓRIO" is "S�?O GREG�?RIO"
and it works for lowercase characters (example: "são" results "são")
Bookmarks