1
0
Fork 0
mirror of https://github.com/subsurface/subsurface.git synced 2025-02-19 22:16:15 +00:00

Support translating UTF8 strings

Interpreting UTF8 encoded strings using tr() instead of trUtf8()
and encoding the string back to utf8 again leads to serious encoding
errors.

Fixes 

Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Maximilian Güntner 2013-11-15 01:39:00 +01:00 committed by Dirk Hohndel
parent c0a6c136f0
commit 17fbb6b17f
2 changed files with 2 additions and 2 deletions

View file

@ -6,7 +6,7 @@ const char *gettextFromC::trGettext(const char *text)
{
QByteArray &result = translationCache[QByteArray(text)];
if (result.isEmpty())
result = tr(text).toUtf8();
result = trUtf8(text).toUtf8();
return result.constData();
}

View file

@ -12,7 +12,7 @@ public:
static gettextFromC *instance();
const char *trGettext(const char *text);
void reset(void);
QHash <QByteArray , QByteArray> translationCache;
QHash <QByteArray, QByteArray> translationCache;
};
#endif // GETTEXTFROMC_H