Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Scripts: read git output as UTF-8 on any system locale (#1326)

Eyal Golanb8d4b8a7ff91
diff --git a/scripts/check.sh b/scripts/check.sh
index 42607d973..c5eb423e3 100755
--- a/scripts/check.sh
+++ b/scripts/check.sh
@@ -12,6 +12,7 @@ cd "$(dirname "$0")/.."
base="${1:-${CHECK_BASE:-origin/main}}"
tail_lines="${CHECK_TAIL:-40}"
export UV_PYTHON="${UV_PYTHON:-3.12}" # the Python CI uses (UV_PYTHON in .github/workflows/ci.yml)
+export PYTHONUTF8=1 # so check.sh reads and writes UTF-8 on any system locale (Windows cp1255)
log="$(mktemp)"
trap 'rm -f "$log"' EXIT
diff --git a/scripts/oss/reviewed_by_guard.py b/scripts/oss/reviewed_by_guard.py
index d1c4a6e9d..019399b36 100644
--- a/scripts/oss/reviewed_by_guard.py
+++ b/scripts/oss/reviewed_by_guard.py
@@ -62,7 +62,8 @@ class GuardError(Exception):
def _git(args: list[str], cwd: Path) -> str:
- return subprocess.run(["git", *CONFIG, *args], cwd=cwd, check=True, capture_output=True, text=True).stdout
+ return subprocess.run(["git", *CONFIG, *args], cwd=cwd, check=True, capture_output=True, text=True,
+ encoding="utf-8").stdout
def _resolve(repo: Path, ref: str) -> str:
diff --git a/scripts/pr_content_summary.py b/scripts/pr_content_summary.py
index a72f2a160..e9cac1607 100644
--- a/scripts/pr_content_summary.py
+++ b/scripts/pr_content_summary.py
@@ -23,7 +23,7 @@ LISTS = ["indicators", "policies", "effects", "situations", "voter_groups", "act
def git(root: Path, *args: str) -> str:
- r = subprocess.run(["git", "-C", str(root), *args], capture_output=True, text=True)
+ r = subprocess.run(["git", "-C", str(root), *args], capture_output=True, text=True, encoding="utf-8")
return r.stdout if r.returncode == 0 else ""