diff options
Diffstat (limited to 'SCons/Tool/textfile.py')
-rw-r--r-- | SCons/Tool/textfile.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/SCons/Tool/textfile.py b/SCons/Tool/textfile.py index c960e67cf..0ec31d8f7 100644 --- a/SCons/Tool/textfile.py +++ b/SCons/Tool/textfile.py @@ -117,10 +117,8 @@ def _action(target, source, env): value = str(value) subs.append((k, value)) - if 'FILE_ENCODING' not in env: - file_encoding = 'utf-8' - else: - file_encoding = env['FILE_ENCODING'] + # Pull file encoding from the environment or default to UTF-8 + file_encoding = env.get('FILE_ENCODING', 'utf-8') # write the file try: @@ -191,6 +189,7 @@ def generate(env): env['BUILDERS']['Substfile'] = _subst_builder env['SUBSTFILEPREFIX'] = '' env['SUBSTFILESUFFIX'] = '' + env['FILE_ENCODING'] = env.get('FILE_ENCODING', 'utf-8') def exists(env): |