Fix T74959: Need to be explicit about UTF8 encoding in py.

Because some OSs are still using old 8bits specific encodings... Angry
eye @windows...
This commit is contained in:
2020-03-20 20:49:48 +01:00
parent 3d9d132ccd
commit 9607e54985
4 changed files with 8 additions and 8 deletions

View File

@@ -1158,7 +1158,7 @@ class I18n:
print("WARNING: skipping file {}, too huge!".format(path))
return None, None, None, False
txt = ""
with open(path) as f:
with open(path, encoding="utf8") as f:
txt = f.read()
_in = 0
_out = len(txt)
@@ -1544,7 +1544,7 @@ class I18n:
"",
self.settings.PARSER_PY_MARKER_END,
]
with open(dst, 'w') as f:
with open(dst, 'w', encoding="utf8") as f:
f.write((prev or "") + "\n".join(txt) + (nxt or ""))
self.unescape()