Files
reliquary/docs/windows-powershell-utf8.md
T
g4borg 4400de7eb2 🚚 export: 16 files (moves)
M .gitignore
M docs/windows-powershell-utf8.md
M plugins/bevy/README.md
M plugins/orbit/README.md
M plugins/orbit/skills/orbit/references/review-recipes.md
M plugins/project-uv/README.md
M plugins/spire/CLAUDE.md
R plugins/spire/agents/attacker.md -> plugins/spire/agents/advocate.md
M plugins/spire/agents/igor.md
M plugins/spire/agents/zathras.md
M plugins/spire/skills/adepts/roster.sh
M plugins/spire/skills/implementation/references/models.md
A plugins/spire/skills/quire/tests/test_roster.py
R plugins/spire/skills/workpad/SKILL.md -> plugins/spire/skills/quire/SKILL.md
R plugins/spire/skills/workpad/tests/test_workpad.py -> plugins/spire/skills/quire/tests/test_quire.py
R plugins/spire/skills/workpad/workpad.py -> plugins/spire/skills/quire/quire.py
2026-11-25 01:52:10 +01:00

54 lines
1.6 KiB
Markdown

# Windows PowerShell UTF-8 Setup
Windows PowerShell 5.1 may read UTF-8 files without a byte order mark as the legacy Windows ANSI code page. When that happens, Unicode text such as gitmoji appears as mojibake:
```text
🤖
```
The file itself can still be valid UTF-8. The problem is usually the decoding choice made by `Get-Content`.
## Fix for the Current User
Add UTF-8 defaults to your Windows PowerShell profile:
```powershell
$PSDefaultParameterValues['Get-Content:Encoding'] = 'UTF8'
$PSDefaultParameterValues['Set-Content:Encoding'] = 'UTF8'
$PSDefaultParameterValues['Add-Content:Encoding'] = 'UTF8'
$PSDefaultParameterValues['Out-File:Encoding'] = 'UTF8'
[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new()
$OutputEncoding = [System.Text.UTF8Encoding]::new()
```
The profile path for Windows PowerShell is usually:
```powershell
$PROFILE
```
On this machine it is:
```text
C:\g4b\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
```
Restart PowerShell after editing the profile.
## One-Off Command
For a single read, pass the encoding explicitly:
```powershell
Get-Content -Encoding UTF8 docs\quire\specs\commit-conventions.md
```
## PowerShell 7
PowerShell 7 (`pwsh`) defaults to UTF-8 more consistently than Windows PowerShell 5.1. If available, using `pwsh` is usually the cleaner long-term fix.
## What This Does Not Change
Repo files such as `.gitattributes` can tell Git how to handle text normalization, but they do not force Windows PowerShell 5.1 to decode files as UTF-8. The shell profile or explicit `-Encoding UTF8` is still needed for `Get-Content`.