From 4ddf4cf1279eb74dcc6329ad9e7f2a316bd4915a Mon Sep 17 00:00:00 2001 From: micbou Date: Thu, 26 Apr 2018 13:10:48 +0200 Subject: [PATCH] Force MSVC to treat source files as UTF-8 encoded --- cpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index b2f3441154..165eb7acde 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -178,10 +178,10 @@ endif() # For MSVC enable UNICODE and compilation on multiple processors. Increase the # number of sections that an object file can hold. This is needed for storing -# the Unicode table. +# the Unicode table. Also, force MSVC to treat source files as UTF-8 encoded. if ( MSVC ) add_definitions( /DUNICODE /D_UNICODE /Zc:wchar_t- ) - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj /utf-8" ) endif() if( MSVC OR CYGWIN OR MSYS)