summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2019-02-12 15:15:47 (GMT)
committerTobias Markmann <tm@ayena.de>2019-02-12 15:19:15 (GMT)
commitfafcdd573702e188873c608153900e764672648d (patch)
tree1fe8985d9b21fa59b8692179a38a6aa8c8717d06
parent2fba2e9743e680b76c070a3604f5d6b56eb44e49 (diff)
downloadswift-fafcdd573702e188873c608153900e764672648d.zip
swift-fafcdd573702e188873c608153900e764672648d.tar.bz2
Force textfile.py tool output encoding to UTF-8
On Windows the preferred encoding is cp1252, which makes zero sense for text files. This change will force it to UTF-8, which is a sensible choice that works best. Test-Information: Build now works on Windows 2012 with MSVC 2015 32bit, with test=unit. Change-Id: I3324d41fe33df98cdd5b90e0712f741f401176c3
-rw-r--r--3rdParty/SCons/02_fix_python_3_windows_unicode.diff13
-rw-r--r--3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py2
2 files changed, 14 insertions, 1 deletions
diff --git a/3rdParty/SCons/02_fix_python_3_windows_unicode.diff b/3rdParty/SCons/02_fix_python_3_windows_unicode.diff
new file mode 100644
index 0000000..f512ba9
--- /dev/null
+++ b/3rdParty/SCons/02_fix_python_3_windows_unicode.diff
@@ -0,0 +1,13 @@
1diff --git a/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
2index 9e2327af3..46176adc1 100644
3--- a/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
4+++ b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
5@@ -127,7 +127,7 @@ def _action(target, source, env):
6 # write the file
7 try:
8 if SCons.Util.PY3:
9- target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='')
10+ target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='', encoding="utf8")
11 else:
12 target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE)
13 except (OSError, IOError):
diff --git a/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
index 9e2327a..46176ad 100644
--- a/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
+++ b/3rdParty/SCons/scons-3.0.1/engine/SCons/Tool/textfile.py
@@ -127,7 +127,7 @@ def _action(target, source, env):
127 # write the file 127 # write the file
128 try: 128 try:
129 if SCons.Util.PY3: 129 if SCons.Util.PY3:
130 target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='') 130 target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='', encoding="utf8")
131 else: 131 else:
132 target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE) 132 target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE)
133 except (OSError, IOError): 133 except (OSError, IOError):