Skip to content

Commit

Permalink
Merge pull request #5409 from ericmehl/encodingCheck
Browse files Browse the repository at this point in the history
Scons : Make encoding check more flexible
  • Loading branch information
johnhaddon authored Aug 9, 2023
2 parents c272f01 + bec54e8 commit 986ce54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ import platform
import shutil
import subprocess
import distutils.dir_util
import codecs

EnsureSConsVersion( 3, 0, 2 ) # Substfile is a default builder as of 3.0.2

if locale.getpreferredencoding() != "UTF-8" :
if codecs.lookup( locale.getpreferredencoding() ).name != "utf-8" :
# The `Substfile` builder uses `open()` without specifying an encoding, and
# so gets Python's default encoding. Unless this is `UTF-8`, any `.py` files
# containing unicode characters will be corrupted during installation.
Expand Down

0 comments on commit 986ce54

Please sign in to comment.