Get-Content source codepage?
问题 I have a plain text .txt file encoded with Windows codepage 1250. I need to read the file on an English/Western Europe Windows system which uses codepage 1252. The Get-Content -Encoding parameter expects a text string from a fixed set which does not include other codepages. I can use GetEncoding(), but this result cannot be used as the -Encoding parameter to Get-Content. How can I tell Get-Content to read the file using 1250 encoding? PS C:\src\t> [System.Text.Encoding]::GetEncoding('windows