Skip to content

Commit 0dc8459

Browse files
t3dotggclaude
andcommitted
fix(install): install.ps1 reads its own shim as UTF-8 on Windows PowerShell 5.1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 5a27694 commit 0dc8459

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/install.ps1‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ $shim = Join-Path $binDir "t3.cmd"
219219
# Replace only a shim that runs a version in this home; never the desktop app's or another t3.
220220
if (Test-Path $shim) {
221221
$existingTarget = ""
222-
foreach ($line in Get-Content $shim) {
222+
# The shim is UTF-8 without a BOM; Windows PowerShell 5.1 reads files as ANSI by default.
223+
foreach ($line in [System.IO.File]::ReadAllLines($shim, [System.Text.Encoding]::UTF8)) {
223224
if ($line -match '^"([^"]+)"') { $existingTarget = $Matches[1]; break }
224225
}
225226
$ownedPrefix = $versionsDir.TrimEnd('\', '/') + [System.IO.Path]::DirectorySeparatorChar

0 commit comments

Comments
 (0)