diff options
author | JinWang An <jinwang.an@samsung.com> | 2022-12-27 17:20:16 +0900 |
---|---|---|
committer | JinWang An <jinwang.an@samsung.com> | 2022-12-27 17:20:16 +0900 |
commit | 47713772c95f12ee5f3a63340b5830ef98c5b0f2 (patch) | |
tree | 3f8fbc0a261a000c63871e99e8fbdfbefde9f58e /Source/QtDialog/CMakeSetup.cxx | |
parent | c7e7726e3cb45fa0e066b1b6fa7e5204acb343b0 (diff) | |
download | cmake-upstream/3.23.3.tar.gz cmake-upstream/3.23.3.tar.bz2 cmake-upstream/3.23.3.zip |
Imported Upstream version 3.23.3upstream/3.23.3
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 8ffa3e728..c55604980 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -10,6 +10,15 @@ #include <QTranslator> #include <QtPlugin> +// FIXME(#23565): Qt6 has QTextCodec in Core5Compat, but using its +// `setCodecForLocale` does not make cmake-gui support non-ASCII chars +// on Windows. For now we only support them with Qt5. How do we support +// them with Qt6, preferably without Core5Compat? +#if defined(Q_OS_WIN) && (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +# include <QTextCodec> +# define CMAKE_HAVE_QTEXTCODEC +#endif + #include "cmsys/CommandLineArguments.hxx" #include "cmsys/Encoding.hxx" #include "cmsys/SystemTools.hxx" @@ -124,6 +133,11 @@ int main(int argc, char** argv) setlocale(LC_NUMERIC, "C"); +#ifdef CMAKE_HAVE_QTEXTCODEC + QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); + QTextCodec::setCodecForLocale(utf8_codec); +#endif + // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) |