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 #230 Signed-off-by: Maximilian Güntner <maximilian.guentner@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c0a6c136f0
commit
17fbb6b17f
2 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue