In a Qt 5.3 application, I have a string literal that contains non-ASCII characters (specifically German Umlauts) that will need to be translated into foreign languages. So I have two issues: (1) I have to mark that literal with tr() and (2) I have to display the string correctly on the screen for which I would seem to have to use QString::fromLatin1() or some such function.
If I do
QString s = tr("ä");
the string is marked for translation but will not display right.
If I do
QString r = QString::fromLatin1("ä");
the string will display right but will not be marked for translation.
How can I combine the two into one? And yes, my source file is saved in UTF8 encoding.
I've been searching up and down the forums and none of the hints work; mainly because most of the solutions apply to Qt 4.8 and have been removed or depreciated for Qt 5.3. Thank you for your help!!
PS: I'm developing using Visual Studio 2010 on Windows 8. According to VS2010 and Notepad++ my sources are saved in UTF8 with BOM encoding.