title: Encoding UTF8 C# Process
body: <p>I have an application which process the vbscript and produces the output.</p>
  
  <pre><code>private static string processVB(string command, string arguments)
  {
      Process Proc = new Process();
      Proc.StartInfo.UseShellExecute = false;
      Proc.StartInfo.RedirectStandardOutput = true;
      Proc.StartInfo.RedirectStandardError = true;
      Proc.StartInfo.RedirectStandardInput = true;
      Proc.StartInfo.StandardOutputEncoding = Encoding.UTF8;
      Proc.StartInfo.StandardErrorEncoding = Encoding.UTF8;
      Proc.StartInfo.FileName = command;
      Proc.StartInfo.Arguments = arguments;
      Proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; //prevent console      window from popping up
      Proc.Start();
      string output = Proc.StandardOutput.ReadToEnd();
      string error = Proc.StandardError.ReadToEnd();
  
      if (String.IsNullOrEmpty(output) &amp;&amp; !String.IsNullOrEmpty(error))
      {
          output = error;
      }
      //Console.Write(ping_output);
  
      Proc.WaitForExit();
      Proc.Close();
  
      return output;
  }
  </code></pre>
  
  <p>I think I have set everything related to Encoding property correct. processVB method will get command as VBscript file and its arguments. </p>
  
  <p>The C# method processVB which is processing that VBScript file now producing the output as follows.</p>
  
  <p>"����?"</p>
  
  <p>But I should get original text</p>
  
  <p>"äåéö€"</p>
  
  <p>I have set Encoding correctly. But I am not able to get it right. </p>
  
  <p>What am I doing wrong?</p>