Reputation: 158
call a script in powershell, and the script's console log is with utf-8 encoding.
what to auto encode stdout into cp936 encoding.
just like this in perl :
binmode STDOUT, ":cp936";
Upvotes: 2
Views: 161
Reputation: 594
You can use the [System.Text.Encoding]::Convert(utf-8,gb2312,$stringtoconvert) See http://msdn.microsoft.com/en-us/library/system.text.encoding(v=vs.110).aspx for the table of supported encodings.
Upvotes: 0