This answer does not answer a direct question - but I noticed a deadlock potential in your code, and thus thought it would be worthy to publish it anyway.
The potential for deadlocks exists because your code tries to synchronously read from redirected output and does this for both: StdOut and StdErr. That is this section of code.
Proc.Start(); string output = Proc.StandardOutput.ReadToEnd(); string error = Proc.StandardError.ReadToEnd(); ... Proc.WaitForExit();
What can happen is that the child process writes a lot of data to StdErr and fills the buffer. When the buffer is full, the child process blocks writing to StdErr (without signaling, but terminating the StdOut stream). And so the child is blocked and does nothing, and your process is blocked, waiting for the child to exit. Dead end!!!
To fix this, at least one (or the best of both) threads should be switched to asynchronous mode.
See the second example on MSDN for specifics of this scenario and how to switch to asynchronous mode.
Regarding the UTF-8 problem, are you sure that your child process is output in this encoding and does not speak in UTF-16 or any other? You might want to examine bytes to try and cancel which encoding stream will be provided so that you can set the correct encoding for interpreting the redirected stream.
EDIT
Here is how I can solve the encoding problem. The main idea is based on what I once needed to do - I had Russian text in an unknown encoding, and I needed to figure out how to convert it so that it displayed the correct characters - take the bytes captured from StdOut and try them decode using all known code pages available in the system. The one that looks right is most likely (but not necessarily) encoded with StdOut encoding. The reason it is not guaranteed, even if it looks right with your data, is because many encodings overlap in some byte ranges, which will make it work the same. For instance. ASCII and UTF8 will have the same bytes when encoding basic Latin characters. Thus, in order to get an exact match, you may need to be creative and tested with some atypical text.
Here is the basic code for this - corrections may be required:
byte[] text = <put here bytes captured from StandardOut of child process> foreach(System.Text.EncodingInfo encodingInfo in System.Text.Encoding.GetEncodings()) { System.Text.Encoding encoding = encodingInfo.GetEncoding(); string decodedBytes = encoding.GetString(bytes); System.Console.Out.WriteLine("Encoding: {0}, Decoded Bytes: {1}", encoding.EncodingName, decodedBytes); }
Run the code and manually view the output. All those that match the expected text are candidates for the coding used by StdOut.