diff options
Diffstat (limited to 'Swift')
| -rw-r--r-- | Swift/QtUI/SConscript | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 584cfea..96979c0 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -1,7 +1,8 @@ import os, datetime, re, time import Version +import SCons.Util def generateQRCTheme(dir, prefix) : sourceDir = dir.abspath result = "<!-- WARNING: This file is automatically generated. Any changes will be overwritten. -->\n" result += "<RCC version =\"1.0\">" @@ -473,15 +474,20 @@ if env["PLATFORM"] == "win32" : # "/DbuildVersion=" + myenv["SWIFT_VERSION"] # ]) #myenv.Nsis("../Packaging/nsis/swift.nsi") if env["SCONS_STAGE"] == "build" and env.get("wix_bindir", None): def convertToRTF(env, target, source) : - infile = open(source[0].abspath, 'r') - outfile = open(target[0].abspath, 'w') + if SCons.Util.PY3: + infile = open(source[0].abspath, 'r', encoding="utf8") + outfile = open(target[0].abspath, 'w', encoding="utf8") + else: + infile = open(source[0].abspath, 'r') + outfile = open(target[0].abspath, 'w') outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\fs16\\f0\\pard\n') for line in infile: - for char in line.decode("utf-8") : + line = line if SCons.Util.PY3 else line.decode("utf-8") + for char in line : if ord(char) > 127 : # FIXME: This is incorrect, because it only works for latin1. # The correct way is \u<decimal utf16 point>? , but this is more # work outfile.write("\\'%X" % ord(char)) |
Swift