Your C++ compiler will convert the character literal '\u00c7' to the two UTF8 bytes 0xC3 0x87. That is what will be in the C-string that you construct the QString from.
The Qt4 QString(const char *) constructor will use fromAscii()/fromLatin1() and misinterpret those bytes resulting in two characters in the QString where there should only be one. What you want is this:
// or
QString s(QString::fromUtf8("Texte en fran\u00e7ais"));
// or
QString s = QString::fromUtf8("Texte en fran\u00e7ais");
To copy to clipboard, switch view to plain text mode
The Qt5 QString(const char *) constructor will use fromUtf8() so this should be fine:
QString s
("Texte en fran\u00e7ais");
QString s("Texte en fran\u00e7ais");
To copy to clipboard, switch view to plain text mode
On Linux qDebug() will generally do the right thing with strings constructed this way.
Bookmarks