39

Is there any way to find what is the default character encoding in Windows? I know that in Western Europe and the US, CP-1252 is the default, but need to check this on other Windows machines too.

Alternatively, is there any list of default encodings per locale?

2 Answers2

48

You can check with PowerShell:

[System.Text.Encoding]::Default

which even enables you to check that across several machines at once.

Joey
  • 41,098
3

In .NET Core and .NET 5+ it is System.Text.Encoding.Default gives instance of UTF8. While .NET 4 and previous versions return Windows Active one. You can find more details on following: Microsoft Reference for Encoding

enter image description here

Imran Javed
  • 131
  • 3