Skip to content

Commit cf2e553

Browse files
committed
Add utf-8 encoding to files
1 parent eef44ca commit cf2e553

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
indent = 11
133133

134134
urllib.request.urlretrieve("https://raw.githubusercontent.com/flintlib/flint/refs/heads/main/AUTHORS", "AUTHORS")
135-
authors_data = open("AUTHORS").read().splitlines()
135+
authors_data = open("AUTHORS", encoding="utf-8").read().splitlines()
136136

137137
lines = authors_data[authors_data.index("Major contributors")+2 : authors_data.index("Other contributors")]
138138
lines_contributors = authors_data[authors_data.index("Other contributors")+5 : authors_data.index("Other credits")]
@@ -262,7 +262,7 @@
262262
text = ""
263263
title = "Documentation"
264264
else:
265-
text = open(source_prefix + page + source_suffix, "r").read()
265+
text = open(source_prefix + page + source_suffix, "r", encoding="utf-8").read()
266266
title = text[text.find("<h2>")+4 : text.find("</h2>")]
267267
page_want_katex.append("%WANT_KATEX" in text)
268268
text = text.replace("%AUTHORLIST", authorlist)
@@ -313,7 +313,7 @@
313313
title = " - " + title
314314

315315
path = sys.argv[1]
316-
fp = open(path + "/" + pages[i] + ".html", "w")
316+
fp = open(path + "/" + pages[i] + ".html", "w", encoding="utf-8")
317317
fp.write(PAGE_TOP.replace("TITLE", title).replace("MENU", menu).replace("%KATEX%", PAGE_KATEX if page_want_katex[i] else ""))
318318
fp.write(page_texts[i])
319319
fp.write(PAGE_BOTTOM.replace("TIMESTAMP", timestamp))

0 commit comments

Comments
 (0)