diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2020-03-20 22:49:48 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2020-03-20 22:52:52 +0300 |
commit | 9607e54985838006ca5695ed88bdaf81dda29b4c (patch) | |
tree | 4e485847825e186e0a01c6d15dcf72fc9e3e073a /release/scripts/modules/bl_i18n_utils/utils.py | |
parent | 3d9d132ccd4511308fbeb2d1ac323ed028a4cd9f (diff) |
Fix T74959: Need to be explicit about UTF8 encoding in py.
Because some OSs are still using old 8bits specific encodings... Angry
eye @windows...
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/utils.py')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index 7c22a86d687..493afc53267 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -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() |