From e83f58e841df689f46264c475dae03cca4c2d0cc Mon Sep 17 00:00:00 2001 From: TY <47445484+R-YaTian@users.noreply.github.com> Date: Wed, 8 Oct 2025 00:23:22 +0800 Subject: [PATCH] Fix compiling on non-UTF8 system, especially Windows (#903) * Fix compiling on non-UTF8 system * Update Makefile * Revert Makefile changes --- utils/transcp.py | 4 ++-- utils/transriff.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/transcp.py b/utils/transcp.py index 3b4cb25..5df294f 100755 --- a/utils/transcp.py +++ b/utils/transcp.py @@ -8,8 +8,8 @@ LANGUAGE_NAME = "GM9_LANGUAGE" VERSION = "GM9_TRANS_VER" parser = ArgumentParser(description="Creates the language.inl file from source.json") -parser.add_argument("source", type=FileType("r"), help="source.json") -parser.add_argument("inl", type=FileType("w"), help="language.inl") +parser.add_argument("source", type=FileType("r", encoding="utf-8"), help="source.json") +parser.add_argument("inl", type=FileType("w", encoding="utf-8"), help="language.inl") args = parser.parse_args() # Load the JSON and handle the meta values diff --git a/utils/transriff.py b/utils/transriff.py index fb13641..1036866 100755 --- a/utils/transriff.py +++ b/utils/transriff.py @@ -147,7 +147,7 @@ def main(source: pathlib.Path, dest: pathlib.Path) -> None: source: JSON to convert from. dest: TRF file to write. """ - data = json.loads(source.read_text()) + data = json.loads(source.read_text(encoding="utf-8")) try: language = get_language(data)