UTF-8 output from PowerShell

后端 未结 4 1784
我在风中等你
我在风中等你 2020-11-28 23:12

I\'m trying to use Process.Start with redirected I/O to call PowerShell.exe with a string, and to get the output back, all in UTF-8. But I don\'t s

4条回答
  •  庸人自扰
    2020-11-28 23:58

    Set the [Console]::OuputEncoding as encoding whatever you want, and print out with [Console]::WriteLine.

    If powershell ouput method has a problem, then don't use it. It feels bit bad, but works like a charm :)

提交回复
热议问题