summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/SCons')
-rw-r--r--BuildTools/SCons/Tools/textfile.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/BuildTools/SCons/Tools/textfile.py b/BuildTools/SCons/Tools/textfile.py
index 89f8963..9b424f2 100644
--- a/BuildTools/SCons/Tools/textfile.py
+++ b/BuildTools/SCons/Tools/textfile.py
@@ -113,7 +113,11 @@ def _action(target, source, env):
lsep = None
for s in source:
if lsep: fd.write(lsep)
- fd.write(_do_subst(s, subs))
+ stringtowrite = _do_subst(s, subs)
+ if isinstance(stringtowrite, str):
+ fd.write(stringtowrite)
+ elif isinstance(stringtowrite, unicode):
+ fd.write(stringtowrite.encode('utf-8'))
lsep = linesep
fd.close()