1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
Description: Some build scripts require LC_ALL=*.utf8 locale. Fix build with LC_ALL=C
Author: Povilas Kanapickas <povilas@radix.lt>
--- a/build_link_map.py
+++ b/build_link_map.py
@@ -38,7 +38,7 @@
link_map = LinkMap()
for fn in sorted(html_files):
- f = open(fn, "r")
+ f = open(fn, "r", encoding='utf-8')
text = f.read()
f.close()
--- a/index2devhelp.py
+++ b/index2devhelp.py
@@ -41,7 +41,7 @@
in_fn = sys.argv[6]
dest_fn = sys.argv[7]
-out_f = open(dest_fn, 'w')
+out_f = open(dest_fn, 'w', encoding='utf-8')
class Index2Devhelp(IndexTransform):
--- a/preprocess.py
+++ b/preprocess.py
@@ -156,14 +156,14 @@
# clean the html files
for fn in html_files:
- f = open(fn, "r")
+ f = open(fn, "r", encoding='utf-8')
text = f.read()
f.close()
text = r1.sub('', text);
text = rlink.sub(rlink_fix, text)
- f = open(fn, "w")
+ f = open(fn, "w", encoding='utf-8')
f.write(text)
f.close()
@@ -176,10 +176,10 @@
# append css modifications
-f = open("preprocess-css.css", "r")
+f = open("preprocess-css.css", "r", encoding='utf-8')
css_app = f.read()
f.close()
-f = open("output/reference/common/site_modules.css", "a")
+f = open("output/reference/common/site_modules.css", "a", encoding='utf-8')
f.write(css_app)
f.close()
@@ -187,7 +187,7 @@
for fn in [ "output/reference/common/site_modules.css",
"output/reference/common/ext.css"]:
- f = open(fn, "r")
+ f = open(fn, "r", encoding='utf-8')
text = f.read()
f.close()
@@ -199,7 +199,7 @@
# QT Help viewer doesn't understand nth-child
text = text.replace('nth-child(1)', 'first-child')
- f = open(fn, "w")
+ f = open(fn, "w", encoding='utf-8')
f.write(text)
f.close()
|