From 180214e4f05f28a3cc0ee4c96f31b64c4bcddea7 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 7 Nov 2018 23:24:31 +0100 Subject: [PATCH] Ref T404, fixed the UTF issues for hotkeys * QStringLiteral expects UTF16 for MSVC compilers * we use descriptive names now * UTF flag for MSVC compilers * added the SLACK discussion as comment under https://dev.swift-project.org/T404 --- mkspecs/features/common_pre.prf | 8 ++++++++ src/blackmisc/input/keyboardkey.cpp | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/common_pre.prf b/mkspecs/features/common_pre.prf index c12549a6c..206230870 100644 --- a/mkspecs/features/common_pre.prf +++ b/mkspecs/features/common_pre.prf @@ -70,6 +70,14 @@ contains(BLACK_CONFIG, ProfileRelease) { msvc:!llvm: QMAKE_CXXFLAGS *= /bigobj +################################ +# Force UTF-8 source code in MSVC +################################ + +msvc: QMAKE_CXXFLAGS *= /utf-8 +# msvc: QMAKE_CXXFLAGS *= /source-charset:utf-8 +# /utf-8 sets both the source charset and execution charset to UTF-8 + ################################ # No gigantic MinGW obj files ################################ diff --git a/src/blackmisc/input/keyboardkey.cpp b/src/blackmisc/input/keyboardkey.cpp index 59500f945..6bfa8ca86 100644 --- a/src/blackmisc/input/keyboardkey.cpp +++ b/src/blackmisc/input/keyboardkey.cpp @@ -57,8 +57,8 @@ namespace BlackMisc switch (m_keyCode) { - case Key_Multiply: return QStringLiteral("×"); - case Key_Divide: return QStringLiteral("÷"); + case Key_Multiply: return QStringLiteral("NumMultiply"); // return QStringLiteral(u"×"); + case Key_Divide: return QStringLiteral("NumDivide"); // return QStringLiteral(u"÷"); case Key_Numpad0: return QStringLiteral("Num0"); case Key_Numpad1: return QStringLiteral("Num1"); case Key_Numpad2: return QStringLiteral("Num2");