From 7797926329b66af85e4565af8109111b58869eb3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 30 Apr 2014 10:37:55 -0700 Subject: [PATCH] Tell Qt4 that we really meant Utf8 when we said Utf8 How strange. Telling Qt4 to assume that all C strings are Utf8 apparently isn't enough to convince tr() that the C strings we pass to it are Utf8. You need to set that codec separately. Fixes #503 Signed-off-by: Dirk Hohndel --- qt-gui.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt-gui.cpp b/qt-gui.cpp index dc3fb4004..f2b655e14 100644 --- a/qt-gui.cpp +++ b/qt-gui.cpp @@ -89,6 +89,9 @@ void init_ui(void) // 106 is "UTF-8", this is faster than lookup by name // [http://www.iana.org/assignments/character-sets/character-sets.xml] QTextCodec::setCodecForCStrings(QTextCodec::codecForMib(106)); + // and for reasons I can't understand, I need to do the same again for tr + // even though that clearly uses C strings as well... + QTextCodec::setCodecForTr(QTextCodec::codecForMib(106)); #ifdef Q_OS_WIN QFile::setDecodingFunction(decodeUtf8); QFile::setEncodingFunction(encodeUtf8);