From 91c0e6fd5117a14739ba24d0885e0e16a7d6c94d Mon Sep 17 00:00:00 2001 From: cadywang Date: Fri, 23 Oct 2026 11:42:27 +0800 Subject: [PATCH] tools: read the governance files as UTF-8 PowerShell 5.1 decodes Get-Content -Raw with the ANSI code page unless it is told otherwise. The two governance JSON files happen to be ASCII today, so nothing breaks -- until a description or a comment carries Chinese, which is exactly what the other two repositories hit while applying their settings: ConvertFrom-Json rejected the file halfway through the UTF-8 bytes. Read both files explicitly as UTF-8. The skills and blog repositories already do. Signed-off-by: cadywang --- tools/create-github-repo.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/create-github-repo.ps1 b/tools/create-github-repo.ps1 index 682a2c9..6498e8b 100644 --- a/tools/create-github-repo.ps1 +++ b/tools/create-github-repo.ps1 @@ -104,8 +104,8 @@ try { & git rev-parse HEAD *> $null if ($LASTEXITCODE -ne 0) { throw 'no commit yet; run: git add -A && git commit' } - $settings = Get-Content -Raw "$root\governance\repository-settings.json" | ConvertFrom-Json - $protection = Get-Content -Raw "$root\governance\branch-protection.json" | ConvertFrom-Json + $settings = Get-Content -Raw -Encoding UTF8 "$root\governance\repository-settings.json" | ConvertFrom-Json + $protection = Get-Content -Raw -Encoding UTF8 "$root\governance\branch-protection.json" | ConvertFrom-Json # GitHub refuses the squash/merge title fields while that strategy is off # ("no_squash_merge_strategy"), so only send the ones the enabled strategies