【问题标题】:does powershell has some function like binmode in perl?powershell 在 perl 中有一些类似 binmode 的功能吗?
【发布时间】:2013-12-19 08:53:41
【问题描述】:

在powershell中调用脚本,脚本的控制台日志为utf-8编码。

如何将标准输出自动编码为 cp936 编码。

就像在 perl 中这样:

binmode STDOUT, ":cp936";

【问题讨论】:

  • CP936是简体中文。你想达到什么目的?

标签: perl powershell stdout


【解决方案1】:

您可以使用 [System.Text.Encoding]::Convert(utf-8,gb2312,$stringtoconvert) 有关支持的编码表,请参阅 http://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-14
    • 1970-01-01
    • 2023-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多