Powershell: Get default system encoding

梦想的初衷 提交于 2019-12-08 14:56:26

问题


The powershell cmdlet out-file has the switch -encoding witch you can set to default. This default value will use the encoding of the system's current ANSI code page.
My question is: How can I get the name of this default encoding that out-file will use with powershell?


回答1:


Take a look at [System.Text.Encoding]::Default, I believe it is used as "default".

E.g. in my case:

[System.Text.Encoding]::Default.EncodingName

gets

Cyrillic (Windows)


来源:https://stackoverflow.com/questions/5326304/powershell-get-default-system-encoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!