Skip to content

Fix setup-windows.ps1 for PowerShell 5.1 by adding UTF-8 BOM - #6

Merged
Finesssee merged 1 commit into
nesszer:mainfrom
stozo04:fix/powershell-utf8-bom
Mar 17, 2026
Merged

Finesssee merged 1 commit into
nesszer:mainfrom
stozo04:fix/powershell-utf8-bom

Conversation

@stozo04

@stozo04 stozo04 commented Mar 17, 2026

Copy link
Copy Markdown

Summary

Fixes a parsing error in setup-windows.ps1 caused by encoding issues on Windows PowerShell 5.1.


Problem

Running setup-windows.ps1 failed with:

The string is missing the terminator: ".

Environment:

  • Windows PowerShell 5.1 (default on Windows 10/11)

Root Cause:
PowerShell 5.1 defaults to ANSI (Windows-1252) encoding when no BOM is present.
The script contains UTF-8 characters (e.g., decorative comment box characters), causing misinterpretation of bytes and breaking parsing.


Fix Applied

  • Saved setup-windows.ps1 as UTF-8 with BOM (EF BB BF).
  • This ensures PowerShell correctly interprets the file as UTF-8.

Changes

File: setup-windows.ps1
Type: Encoding-only change (no logic or content modifications)

Diff Summary:

  • No functional changes to the script
  • File appears modified due to the addition of a BOM
  • Script behavior remains identical

Why This Fix

  • ✅ No behavior changes
  • ✅ Maintains full backward compatibility
  • ✅ Ensures script works out-of-the-box on Windows PowerShell 5.1
  • ✅ Removes a common first-run failure for Windows developers

How to Verify

Run the script:

./setup-windows.ps1

Expected Result:

  • Script executes successfully
  • Rust and MinGW install without errors
  • No "missing terminator" parsing issues

BEFORE:
image

AFTER:

image

@Finesssee
Finesssee merged commit 3007834 into nesszer:main Mar 17, 2026
@Finesssee

Copy link
Copy Markdown
Collaborator

Thanks for the fix @stozo04! Verified the diff — encoding-only change (UTF-8 BOM added), no logic modifications. PowerShell 5.1 compatibility confirmed. Merged ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants