From c57568cb34f5a8f97999588d66515bcdd852db17 Mon Sep 17 00:00:00 2001 From: Yuro Date: Thu, 16 Apr 2026 13:31:50 +0800 Subject: [PATCH] fix: specify UTF-8 encoding when reading .csproj file On Windows systems with non-UTF-8 locale (e.g. Chinese GBK), Python's open() defaults to the system encoding, causing UnicodeDecodeError when reading UTF-8 encoded .csproj files. Fixes UnicodeDecodeError: 'gbk' codec can't decode byte... --- build/mono_decomp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/mono_decomp.py b/build/mono_decomp.py index f376197fd..2a3d48669 100644 --- a/build/mono_decomp.py +++ b/build/mono_decomp.py @@ -49,7 +49,7 @@ def get_godot_mono_decomp_lib_dir(godot_mono_decomp_dir, target_platform, target triplet = get_godot_mono_triplet(target_platform, target_arch) target_framework = "net9.0" csproj_path = os.path.join(godot_mono_decomp_dir, "GodotMonoDecompNativeAOT.csproj") - with open(csproj_path, "r") as csproj_file: + with open(csproj_path, "r", encoding="utf-8") as csproj_file: for line in csproj_file: if "TargetFramework" in line: target_framework = line.split(">")[1].split("<")[0].strip()