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 75 76 77 78 79 80
|
Description: Some build scripts require LC_ALL=*.utf8 locale. Fix build with LC_ALL=C
Author: Povilas Kanapickas <povilas@radix.lt>
Index: cppreference-doc/build_link_map.py
===================================================================
--- cppreference-doc.orig/build_link_map.py
+++ cppreference-doc/build_link_map.py
@@ -38,7 +38,7 @@ def build_link_map(directory):
link_map = LinkMap()
for fn in html_files:
- f = open(fn, "r")
+ f = open(fn, "r", encoding='utf-8')
text = f.read()
f.close()
Index: cppreference-doc/index2devhelp.py
===================================================================
--- cppreference-doc.orig/index2devhelp.py
+++ cppreference-doc/index2devhelp.py
@@ -41,7 +41,7 @@ rel_link = sys.argv[5]
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):
Index: cppreference-doc/preprocess.py
===================================================================
--- cppreference-doc.orig/preprocess.py
+++ cppreference-doc/preprocess.py
@@ -147,14 +147,14 @@ def rlink_fix(match):
# 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()
@@ -167,10 +167,10 @@ for fn in html_files:
# 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()
@@ -178,7 +178,7 @@ f.close()
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()
@@ -190,7 +190,7 @@ for fn in [ "output/reference/common/sit
# 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()
|