diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-04-23 18:53:42 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-04-23 18:54:15 (GMT) |
commit | cf7715deac49b54339b29d759c5c2ba899e28a90 (patch) | |
tree | 9179ea5afa6244c3433a05e3f7c09eb31ca3bb4c /Swift/QtUI/SConscript | |
parent | 2d436118c2a3907080fa850a3dcab2e99120a7bc (diff) | |
download | swift-cf7715deac49b54339b29d759c5c2ba899e28a90.zip swift-cf7715deac49b54339b29d759c5c2ba899e28a90.tar.bz2 |
Encode characters in COPYING RTF file correctly.
Diffstat (limited to 'Swift/QtUI/SConscript')
-rw-r--r-- | Swift/QtUI/SConscript | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index b6f6229..0313f1e 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -287,7 +287,14 @@ if env["PLATFORM"] == "win32" : outfile = open(target[0].abspath, 'w') outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\n') for line in infile: - outfile.write(line) + for char in line.decode("utf-8") : + 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)) + else : + outfile.write(char) outfile.write('\\par') outfile.write('}') outfile.close() |