If your text file is saved with UTF-8 encoding and your compiler does not do something silly with "non-ASCII" characters then this:
QString thingy
= QString::fromUtf8("Où sont mes accents?");
// French
QString thingy = QString::fromUtf8("Où sont mes accents?"); // French
To copy to clipboard, switch view to plain text mode
should work. If the text file is saved with the ISO8859-1 Western European encoding then:
QString thingy
= QString::fromLatin1("¿Dónde están mis acentos?");
// Spanish
QString thingy = QString::fromLatin1("¿Dónde están mis acentos?"); // Spanish
To copy to clipboard, switch view to plain text mode
In the worst case you might have to manually encode the characters:
// Portguese: Onde estão meus acentos?
QString thingo
= QString::fromUtf8("Onde est\u00E3o meus acentos?");
// works with gcc but not IIRC Microsoft compilers
QString thingy
= QString::fromUtf8("Onde est\xC3\xA3o meus acentos?");
// should work with either
QString foo
= QString::fromUtf8("Nerede benim aksan vard\u0131r?");
// Turkish (dotless i)
// Portguese: Onde estão meus acentos?
QString thingo = QString::fromUtf8("Onde est\u00E3o meus acentos?"); // works with gcc but not IIRC Microsoft compilers
QString thingy = QString::fromUtf8("Onde est\xC3\xA3o meus acentos?"); // should work with either
QString foo = QString::fromUtf8("Nerede benim aksan vard\u0131r?"); // Turkish (dotless i)
QString bar = QString::fromUtf8("Nerede benim aksan vard\xC4\xB1r?");
To copy to clipboard, switch view to plain text mode
ISO8859-1 does not completely support languages like Turkish. I used http://people.w3.org/rishida/tools/conversion/ to encode.
If they are fixed messages or control labels then you could enter them in English and use the translation mechanism to provide translated versions.
Without knowing what platform, compiler, languages, or code is involved it is hard to be more specific.
BTW: Apologies to native French, Spanish, Portuguese, and Turkish speakers for the Google Translate examples
Bookmarks