Now we don't have a full set of encoding tests (only for redirections). We need to create them during future Encoding RFC implementation (?).
In #3467 (discussion Issue #3248) we fix Default/OEM encoding behavior PowerShell Core on Windows (as in Windows PowerShell) but don't add tests (waiting the RFC). The simplest test (from @mklement0) is:
# Setup:
# Create a no-BOM UTF-8 file with the following literal content:
# 'ö'
# which, when executed as a PS script, should echo 'ö' back, IF the script
# was correctly decoded from UTF-8 by PS.
# UTF-8 bytes: 0x27 (single quote), 0xc3 0xb6 (encoding of 'ö', U+00F6), 0x27 (single quote)
[byte[]] (0x27, 0xc3, 0xb6, 0x27) | Set-Content -Encoding Byte /tmp/$PID.ps1
# Test: See if the 'ö' is echoed back correctly.
# Should return $True
'ö' -eq (& /tmp/$PID.ps1)
We need test for: