The other day u/Practical_Air6315 had a couple of threads dealing with issues ex: not knowing if a file is ShiftJIS or UTF8NoBOM encoded
Can you just decode as utf8, checking for errors? If yes, use ShiftJIS otherise utf8? Or can you sometimes have zero decoding errors but it still maps to malformed json? Is there a better method?
I used:
function Test-ShiftJISDecodeError {
# ...
$Utf8Strict = [System.Text.UTF8Encoding]::new(
<# shouldEmitUtf8BOM #> $false,
<# should throw on decode error #> $true )
$bytes = [System





