fix: use UTF-8 for text file operations

This commit is contained in:
Haoran
2026-08-24 20:28:37 +08:00
parent a32a73f700
commit 199402f9d4
59 changed files with 435 additions and 289 deletions

View File

@@ -41,7 +41,7 @@ def safe_path(p: str) -> Path:
return path
def run_read(path: str, limit: int = None) -> str:
text = safe_path(path).read_text()
text = safe_path(path).read_text(encoding="utf-8")
lines = text.splitlines()
if limit and limit < len(lines):
lines = lines[:limit]