diff --git a/cmake/Modules/MacroQbtCommonConfig.cmake b/cmake/Modules/MacroQbtCommonConfig.cmake index 4b70fa9ef..9b789b2fe 100644 --- a/cmake/Modules/MacroQbtCommonConfig.cmake +++ b/cmake/Modules/MacroQbtCommonConfig.cmake @@ -70,8 +70,12 @@ macro(qbt_common_config) endif() if (MSVC) - target_compile_options(qbt_common_cfg INTERFACE /guard:cf) - target_link_options(qbt_common_cfg INTERFACE /guard:cf + target_compile_options(qbt_common_cfg INTERFACE + /guard:cf + /utf-8 + ) + target_link_options(qbt_common_cfg INTERFACE + /guard:cf $<$>:/OPT:REF /OPT:ICF> # suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON $<$:/INCREMENTAL:NO> diff --git a/src/base/unicodestrings.h b/src/base/unicodestrings.h index 9065c1693..245f99626 100644 --- a/src/base/unicodestrings.h +++ b/src/base/unicodestrings.h @@ -1,4 +1,4 @@ -/* +/* * Bittorrent Client using Qt and libtorrent. * Copyright (C) 2015 Mike Tzou * @@ -28,11 +28,6 @@ #pragma once -// This file must be encoded in "UTF-8 with BOM" -#ifdef _MSC_VER -#pragma execution_character_set("utf-8") -#endif - // Because of the poor handling of UTF-8 characters in MSVC (emits warning C4819), // we put all problematic UTF-8 chars/strings in this file. // See issue #3059 for more details (https://github.com/qbittorrent/qBittorrent/issues/3059). diff --git a/winconf.pri b/winconf.pri index 7fc06116e..26e58cc1c 100644 --- a/winconf.pri +++ b/winconf.pri @@ -40,7 +40,7 @@ win32-g++* { } else:win32-msvc* { CONFIG -= embed_manifest_exe - QMAKE_CXXFLAGS += /std:c++17 + QMAKE_CXXFLAGS += /std:c++17 /utf-8 QMAKE_LFLAGS += "/MANIFEST:EMBED /MANIFESTINPUT:$$quote($${PWD}/src/qbittorrent.exe.manifest) /STACK:0x800000" RC_FILE = qbittorrent.rc