summaryrefslogtreecommitdiff
path: root/platform/windows/detect.py
diff options
context:
space:
mode:
authorWindy Darian <p123456638@msn.com>2019-04-10 22:58:49 -0400
committerWindy Darian <p123456638@msn.com>2019-04-10 23:01:05 -0400
commitff3fdabc52a09c8f4ed6549f4366896e47876471 (patch)
treeaaed8bd3af182ec9aa8e8b714d0d2212d9c13fbf /platform/windows/detect.py
parent5823b5d77d47339c3c981953ca8178e7ef14b6df (diff)
Force utf-8 source file encoding in MSVC
On Windows, when "Language for non-Unicode programs" were set to "Japanese (Japan)", MSVC would by default use Shift JIS (code page 932) to interpret source files, which would result in test_string failing to compile because of characters in `test_34()`. Forcing utf-8 for MSVC fixes the issue
Diffstat (limited to 'platform/windows/detect.py')
-rw-r--r--platform/windows/detect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 0118b5bae2..15e8f33eae 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -195,7 +195,7 @@ def configure_msvc(env, manual_msvc_config):
## Compile/link flags
- env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
+ env.AppendUnique(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo', '/utf-8'])
env.AppendUnique(CXXFLAGS=['/TP']) # assume all sources are C++
if manual_msvc_config: # should be automatic if SCons found it
if os.getenv("WindowsSdkDir") is not None: