From 94d0b9111b24687e44f65cdf1e5c691e249ee50d Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Wed, 20 Sep 2023 00:56:55 +0100 Subject: [PATCH] Use UTF-8 for MSVC source and execution charset (#6876) --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b17d0e7c98..c1cf3406ba4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -651,6 +651,9 @@ IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") ELSE(WIN32) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DPIC") ENDIF(WIN32) +elseif(MSVC) + # Use UTF-8 as the source and execution character set + add_compile_options("/utf-8") ENDIF() # add enabled sanitizers