From ad8acef02c1058fe6f44a61a9f6c610f3740cff0 Mon Sep 17 00:00:00 2001 From: d3agle Date: Mon, 10 Aug 2015 17:48:01 -0500 Subject: [PATCH] #321 Fix Sets the output encoding to the OEM's code page --- Client/Core/Utilities/Shell.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Client/Core/Utilities/Shell.cs b/Client/Core/Utilities/Shell.cs index bbbfca8c..fc97da15 100644 --- a/Client/Core/Utilities/Shell.cs +++ b/Client/Core/Utilities/Shell.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Text; using System.Threading; @@ -44,6 +45,8 @@ private void CreateSession() _read = true; } + CultureInfo cultureInfo = CultureInfo.InstalledUICulture; + _prc = new Process { StartInfo = new ProcessStartInfo("cmd") @@ -52,6 +55,8 @@ private void CreateSession() RedirectStandardInput = true, RedirectStandardOutput = true, RedirectStandardError = true, + StandardOutputEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage), + StandardErrorEncoding = Encoding.GetEncoding(cultureInfo.TextInfo.OEMCodePage), CreateNoWindow = true, WorkingDirectory = Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)), Arguments = "/K"