设置 StandardErrorEncoding

This commit is contained in:
智能大石头 2024-12-25 11:22:14 +08:00
parent 0567236068
commit 847cfa2dad
1 changed files with 3 additions and 0 deletions

View File

@ -51,6 +51,8 @@ class Program
manager.Load();
manager.Init();
XTrace.WriteLine("代码插件[{0}]{1}", manager.Plugins.Length, manager.Plugins.Join(",", e => e.GetType().Name));
// 在当前目录查找模型文件
var file = "";
if (args.Length > 0) file = args.LastOrDefault();
@ -309,6 +311,7 @@ class Program
RedirectStandardOutput = true,
RedirectStandardError = true,
StandardOutputEncoding = Encoding.UTF8,
StandardErrorEncoding = Encoding.UTF8,
};
var process = Process.Start(psi);
if (process == null) return null;