title: Capturing output from standard io encoding?
body: <p>I'm piping the output of an app into my .NET app.</p>
  
  <p>The encoding is somewhat strange.
  Letters ÅÄÖ shows up as ├Ñ ├ñ ├Â</p>
  
  <p>I have tried to convert back and forth from various different encodings w/o any success.
  Anyone know how the string should be converted correctly here?</p>
  
  <p>e.g. the documentation for the app says the output is UTF8, so I've tried this:</p>
  
  <pre><code>byte[] encodedBytes = Encoding.UTF8.GetBytes(theOutput);
  var res = Encoding.Default.GetString(encodedBytes);
  </code></pre>
  
  <p>Which goves the incorrect result.</p>
  
  <p>edit:
  code:</p>
  
  <pre><code>var processStartInfo = new ProcessStartInfo
  {
     CreateNoWindow = true,
     RedirectStandardOutput = true,
     RedirectStandardInput = true,
     UseShellExecute = false,
     Arguments = a,
     FileName = path + "\\phantomjs.exe"
  };
  
  var process = new Process
  {
     StartInfo = processStartInfo,
     EnableRaisingEvents = true
  };
  
  //capturing output here
  process.OutputDataReceived += 
     (sender, args) =&gt; outputBuilder.Append(args.Data);
  
  process.Start();
  process.BeginOutputReadLine();
  process.WaitForExit(20000);
  process.CancelOutputRead();
  </code></pre>