Fix compiling on non-UTF8 system, especially Windows (#903)

* Fix compiling on non-UTF8 system

* Update Makefile

* Revert Makefile changes
This commit is contained in:
TY 2025-10-08 00:23:22 +08:00 committed by GitHub
parent cf1cb1cfc5
commit e83f58e841
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ LANGUAGE_NAME = "GM9_LANGUAGE"
VERSION = "GM9_TRANS_VER" VERSION = "GM9_TRANS_VER"
parser = ArgumentParser(description="Creates the language.inl file from source.json") parser = ArgumentParser(description="Creates the language.inl file from source.json")
parser.add_argument("source", type=FileType("r"), help="source.json") parser.add_argument("source", type=FileType("r", encoding="utf-8"), help="source.json")
parser.add_argument("inl", type=FileType("w"), help="language.inl") parser.add_argument("inl", type=FileType("w", encoding="utf-8"), help="language.inl")
args = parser.parse_args() args = parser.parse_args()
# Load the JSON and handle the meta values # Load the JSON and handle the meta values

View File

@ -147,7 +147,7 @@ def main(source: pathlib.Path, dest: pathlib.Path) -> None:
source: JSON to convert from. source: JSON to convert from.
dest: TRF file to write. dest: TRF file to write.
""" """
data = json.loads(source.read_text()) data = json.loads(source.read_text(encoding="utf-8"))
try: try:
language = get_language(data) language = get_language(data)