0

I am using proc.BeginOutputReadLine(); proc.BeginErrorReadLine(); for reading content and storing to output variable, but this is working only for english language.

process.OutputDataReceived is not firing for non english characters.

bool IsProcessKilled = false;
proc.EnableRaisingEvents = false;
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.StartInfo.FileName = pCommand;
proc.StartInfo.Arguments = pArguments;
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.Verb = "runas";
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.UseShellExecute = false;

proc.OutputDataReceived += (sender, e) => { if (e.Data == null) { outputWaitHandle.Set(); } else { sbOutput.AppendLine(e.Data); } };
proc.ErrorDataReceived += (sender, e) => { if (e.Data == null) { errorWaitHandle.Set(); } else { sbOutput.AppendLine(e.Data); } };

proc.BeginOutputReadLine();
proc.BeginErrorReadLine();

This gave error and not able to read.

0 Answers0