Skip to content

Commit

Permalink
Set source character sets to UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Jan 7, 2021
1 parent b79a1b5 commit 24fa9e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 6 additions & 2 deletions cmake/Modules/MacroQbtCommonConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<$<NOT:$<CONFIG:Debug>>:/OPT:REF /OPT:ICF>
# suppress linking warning due to /INCREMENTAL and /OPT:ICF being both ON
$<$<CONFIG:RelWithDebInfo>:/INCREMENTAL:NO>
Expand Down
7 changes: 1 addition & 6 deletions src/base/unicodestrings.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2015 Mike Tzou
*
Expand Down Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion winconf.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24fa9e3

Please sign in to comment.