diff options
| author | six-6 | 2023-06-08 00:14:41 +0800 |
|---|---|---|
| committer | GitHub | 2023-06-07 18:14:41 +0200 |
| commit | b4177b52676321cd4a5fe7a336a4f09e50274f86 (patch) | |
| tree | bb4a8d11e74eac302304f6eb93e89ae8cba3d434 | |
| parent | b05dfd10d22372ebd1501293ccedaae1a35750d9 (diff) | |
| download | unexpected-keyboard-b4177b52676321cd4a5fe7a336a4f09e50274f86.tar.gz unexpected-keyboard-b4177b52676321cd4a5fe7a336a4f09e50274f86.zip | |
Use utf-8 encoding while formatting translations on Windows. (#376)
When running sync_translations.py on Windows, an error will show because it use gbk encoding by default. Using utf-8 encoding explicitly can fix it.
| -rw-r--r-- | sync_translations.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sync_translations.py b/sync_translations.py index f0bb542..97c0ecc 100644 --- a/sync_translations.py +++ b/sync_translations.py @@ -34,5 +34,5 @@ baseline = parse_strings_file("res/values/strings.xml") for strings_file in glob.glob("res/values-*/strings.xml"): print(strings_file) strings = dict(parse_strings_file(strings_file)) - with open(strings_file, "w") as out: + with open(strings_file, "w", encoding="utf-8") as out: write_updated_strings(out, baseline, strings) |
