aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-gui.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/qt-gui.cpp b/qt-gui.cpp
index 94945cdbf..2f3e66bea 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -136,6 +136,12 @@ void init_ui(void)
QFile::setDecodingFunction(decodeUtf8);
QFile::setEncodingFunction(encodeUtf8);
#endif
+#else
+ // for Win32 and Qt5 we try to set the locale codec to UTF-8.
+ // this makes QFile::encodeName() work.
+#ifdef Q_OS_WIN
+ QTextCodec::setCodecForLocale(QTextCodec::codecForMib(106));
+#endif
#endif
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");