mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-20 22:24:54 +00:00
Based on the conclusion in discussion #3248, this PR fix "OEM" and "Default" encoding in powershell. 1. OEM -- We need an internal fix because .Net Core has no "OEM" encoding. The fix gives the following PowerShell Core behavior on "OEM" encoding: - on Windows - as Windows PowerShell based on GetOEMCP() and legacy encodings (System.Text.Encoding.CodePages) - on Unix - the same as default encoding in PowerShell Core 2. Default -- We need internal fix because CoreFX `Encoding.default` for all platforms is UTF8. Until we complete the `Encoding RFC` we should restore behavior as in Windows PowerShell. The fix gives the following PowerShell Core behavior on "Default" encoding: - on Windows - as Windows PowerShell based on GetACP() and legacy encodings (System.Text.Encoding.CodePages) - on Unix - UTF-8 without BOM (We are expecting that the same will be [in CoreFX](https://github.com/dotnet/coreclr/issues/10643))