qt-qui.cpp: set the locale codec to UTF-8 on Win32

This makes QFile::encodeName() work and filenames
with special chars on Win32 can be opened again.

Fixes #740

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2014-10-29 18:14:42 +02:00 committed by Dirk Hohndel
parent 3b5781508c
commit 9e4cc81068

View file

@ -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");