You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install.ps1's programs read a byte-order mark from their closed standard input under Windows PowerShell 5.1 with a UTF-8 console #1104
Under Windows PowerShell 5.1 with a UTF-8 console, every program install.ps1 runs (self install, writ repo set, writ repo list) reads a byte-order mark, EF BB BF, from the standard input #1044 closed for it, before the end of that input. Ruled 2026-10-20: "We do not store boms. Ever!"
Reproduced 2026-10-20 on danoble-wd11-3 (windows/arm64, 5.1.26100.9711): with [Console]::InputEncoding UTF-8, a program started by develop's Invoke-NativeCommand reads 239,187,191; with the machine's OEM encoding (437), nothing. Under PowerShell 7.6.6, nothing either way. CI's runners have a UTF-8 console; this machine's is OEM, which is why install.ps1 narrates, fails and runs programs as the PowerShell style guide's section 7 says #1044's own run here passed.
Cause
.NET Framework 4.8 (Windows PowerShell 5.1) builds a redirected standard input's writer from Console.InputEncoding and turns AutoFlush on at Process.Start, which writes the encoding's preamble at once: closing the writer, or the stream under it, cannot keep it out (tried on danoble-wd11-3). Its ProcessStartInfo has no StandardInputEncoding; .NET 10 (PowerShell 7) has one, and writes no preamble.
Fix
Ruled 2026-10-20, offered this, an inherited standard input, or cmd /c ... < NUL: "Implement your solution." Invoke-NativeCommand sets [Console]::InputEncoding to UTF-8 without a preamble for the moment Process.Start runs, when it is UTF-8 with one, and restores the caller's in a finally. The code page is 65001 throughout: section 7's rule that a script never changes the console's code page holds. Tried on danoble-wd11-3 under both editions: the program reads nothing, and the console's input encoding is the caller's again afterwards.
The suite's stdin check sets the probing session's input encoding to UTF-8 with a preamble first, so it catches the mark whatever console a runner has.
Activity