diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/locale_database/cldr2qlocalexml.py | 2 | ||||
-rw-r--r-- | util/locale_database/localetools.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/util/locale_database/cldr2qlocalexml.py b/util/locale_database/cldr2qlocalexml.py index d4ba6960517..0aa04b64b05 100755 --- a/util/locale_database/cldr2qlocalexml.py +++ b/util/locale_database/cldr2qlocalexml.py @@ -83,7 +83,7 @@ def main(argv: list[str], out: TextIO, err: TextIO) -> int: parser.error(f'Please use a .xml extension on your output file name, not {xml}') else: try: - emit = open(xml, 'w') + emit = open(xml, 'w', encoding="utf-8") except IOError as e: parser.error(f'Failed to open "{xml}" to write output to it') diff --git a/util/locale_database/localetools.py b/util/locale_database/localetools.py index 10937df5485..818880d6efa 100644 --- a/util/locale_database/localetools.py +++ b/util/locale_database/localetools.py @@ -110,7 +110,7 @@ def AtomicRenameTemporaryFile(originalLocation: Path, *, prefix: str, dir: Path) On success closes the temporary file and moves its content to the original location. On error, removes temporary file, without disturbing the original. """ - tempFile = NamedTemporaryFile('w', prefix=prefix, dir=dir, delete=False) + tempFile = NamedTemporaryFile('w', prefix=prefix, dir=dir, delete=False, encoding='utf-8') try: yield tempFile tempFile.close() @@ -174,7 +174,7 @@ class Transcriber: self.writer = resources.enter_context( AtomicRenameTemporaryFile(self.path, prefix=self.path.name, dir=self.tempDir)) # Open the old file - self.reader = resources.enter_context(open(self.path)) + self.reader = resources.enter_context(open(self.path, encoding='utf-8')) self.onEnter() |