The "square" is probably a placeholder for bytes in the string that are either invalid sequences or have no glyph in the current font.
Your editor or compiler could be mangling UTF8 input. Try this and see what you get:
#include <QtCore>
int main(int argc, char **argv)
{
QString test
= QString::fromUtf8("\x2E\xD8\xA7\xD9\x84\xD8\xAC\xD8\xAF\xD9\x8A\xD8\xAF");
qDebug() << test;
return 0;
}
#include <QtCore>
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
QString test = QString::fromUtf8("\x2E\xD8\xA7\xD9\x84\xD8\xAC\xD8\xAF\xD9\x8A\xD8\xAF");
qDebug() << test;
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks