utf-8 encoding index writing

This commit is contained in:
Gitea 2021-12-12 11:40:31 +00:00
parent 3d8dd1fbc1
commit 33a12cca03

View File

@ -275,7 +275,7 @@ def main (args):
if "text" in versions_by_type:
try:
with open (versions_by_type["text"]["path"]) as f:
with open (versions_by_type["text"]["path"], encoding="utf-8") as f:
p["text"] = f.read()
except FileNotFoundError:
p['text'] = ''
@ -320,7 +320,7 @@ def main (args):
if args.output:
with open(args.output, "w") as f:
with open(args.output, "w", encoding="utf-8") as f:
print (template.render(vars(args)), file=f)
else:
print (template.render(vars(args)))