From f9780ec53ea697d782f762f15d3f0d5a9c4e80b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=AA=E7=9F=A5=E6=97=B6=E5=85=89?= <732857315@qq.com> Date: Wed, 29 Oct 2025 14:43:32 +0800 Subject: [PATCH] MSYS2 mingw64 in Win10 Error : Add UTF-8 encoding to file read operation An Error in Win10 for MSYS2 mingw64,GBK: src/build.py", line 167, in sys.stdout.write(open(f, 'r').read()) ^^^^^^^^^^^^^^^^^^^ UnicodeDecodeError: 'gbk' codec can't decode byte 0x99 in position 751: illegal multibyte sequence make: *** [Makefile:56: nuke] Error 1 --- src/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.py b/src/build.py index ff5c455d8..06689294d 100644 --- a/src/build.py +++ b/src/build.py @@ -164,6 +164,6 @@ def fix_comments(str): print("\n/*") for f in outro_files: - sys.stdout.write(open(f, 'r').read()) + sys.stdout.write(open(f, 'r',encoding='utf-8').read()) print("*/\n")