What's Fixed
GitHub Copilot Garbled Characters — Root Cause Found (Issue #82)
v2.16.1 fixed the output pipe encoding but the issue persisted. The real root cause was on the read side, not the write side.
What was wrong:
All Get-Content calls in the PS1 hook scripts had no -Encoding parameter. In PowerShell 5.x, Get-Content without an explicit encoding reads files using the system ANSI code page (Windows-1252 in most Western locales). Any non-ASCII character in task_plan.md or SKILL.md — emoji, CJK characters, accented letters — was corrupted before it ever reached the output pipe. Fixing the pipe encoding did nothing because the string was already garbled at the source.
Secondary fix: [System.Text.Encoding]::UTF8 returns UTF-8 with BOM. Replaced with [System.Text.UTF8Encoding]::new($false) across all four PS1 scripts to prevent a stray 0xEF 0xBB 0xBF preamble from reaching JSON parsers.
Fixed files: pre-tool-use.ps1, session-start.ps1, agent-stop.ps1, post-tool-use.ps1
Bash scripts were already correct from v2.16.1.
Contributors
Full Changelog
https://github.com/OthmanAdi/planning-with-files/blob/master/CHANGELOG.md