refactor(windows scripts): remove BOM and improve UTF-8 handling

This commit is contained in:
2026-09-09 15:48:32 -04:00
parent d27bf49c40
commit bdeb9c767a
19 changed files with 148 additions and 89 deletions
+7 -1
View File
@@ -1,6 +1,12 @@
<#
LXS - platform dispatcher (Windows side)
NOTE: this file must stay BOM-less and pure ASCII. It is the one script
fetched with `irm ... | iex`, and Invoke-Expression fails on a leading
U+FEFF. Being ASCII keeps it parseable when Windows PowerShell 5.1 falls
back to the ANSI codepage for a BOM-less file. Everything under windows\
carries a UTF-8 BOM instead, because 5.1 reads those from disk.
Thin shim kept at the repo root so the documented one-liner stays short and
stable while the real implementation lives in windows\lxs.ps1:
@@ -40,7 +46,7 @@ if ($LxsSelfDir) {
}
}
# No files on disk we were piped from irm. Fetch the platform entrypoint.
# No files on disk - we were piped from irm. Fetch the platform entrypoint.
$temp = Join-Path $env:TEMP ("lxs.entrypoint.{0}.ps1" -f [guid]::NewGuid().ToString('N').Substring(0, 8))
try {
Invoke-WebRequest -Uri "$LxsRawBase/$LxsPlatformDir/lxs.ps1" -OutFile $temp `