Skip to content

Commit

Permalink
修正封装时,路径存在中文出现的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
YohoYang committed Jul 30, 2022
1 parent 972c644 commit 2ea3f9f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions VSGUI/API/MuxApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static string ProcessMuxCommandStr(string[] input, string output, out str
addstr += " " + "\"" + item + "\"";
}
}
string theCommandStr = @"mkvmerge.exe" + addstr + " -o " + "\"" + output + "\"";
string theCommandStr = @"mkvmerge.exe --ui-language en" + addstr + " -o " + "\"" + output + "\"";
return theCommandStr;
}
clipath = "";
Expand All @@ -63,7 +63,7 @@ public static void StartSMux(string[] input, string outputsuffix, Action<string>

string common = ProcessMuxCommandStr(input, output, out string clipath);

ProcessApi.RunProcess(clipath, common, DataReceived, Exited, out string pid, true);
ProcessApi.RunProcess(clipath, common, DataReceived, Exited, out string pid);
void DataReceived(DataReceivedEventArgs e, bool processIsExited)
{
datarecevied += e.Data;
Expand Down
12 changes: 6 additions & 6 deletions VSGUI/API/ProcessApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void Proc_DataReceived(object sender, DataReceivedEventArgs e)
}


public static void RunProcess(string clipath, string common, Action<DataReceivedEventArgs, bool> inDataReceived, Action inExited, out string processid, bool enableutf8 = false)
public static void RunProcess(string clipath, string common, Action<DataReceivedEventArgs, bool> inDataReceived, Action inExited, out string processid)
{

Process proc = new Process
Expand All @@ -167,11 +167,11 @@ public static void RunProcess(string clipath, string common, Action<DataReceived
RedirectStandardOutput = true,
}
};
if (enableutf8)
{
proc.StartInfo.StandardOutputEncoding = Encoding.UTF8;
proc.StartInfo.StandardErrorEncoding = Encoding.UTF8;
}
//if (utf8Output)
//{
// proc.StartInfo.StandardOutputEncoding = Encoding.UTF8;
// proc.StartInfo.StandardErrorEncoding = Encoding.UTF8;
//}
proc.OutputDataReceived += Proc_DataReceived;
proc.ErrorDataReceived += Proc_DataReceived;
proc.EnableRaisingEvents = true;
Expand Down
3 changes: 2 additions & 1 deletion VSGUI/API/QueueApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public static string ProcessCommandStr(int queueid, string type, int encoderid,
if (type == "mux")
{
tempoutput = Path.GetDirectoryName(output) + @"\" + "VSGUI_Job_" + queueid.ToString() + "_temp" + Path.GetExtension(output);
string outputpath = "\"" + tempoutput + "\"";
//string outputpath = "\"" + tempoutput + "\"";
string outputpath = tempoutput;
string common = MuxApi.ProcessMuxCommandStr(input, outputpath, out clipath);
return common;
}
Expand Down
2 changes: 1 addition & 1 deletion VSGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public partial class MainWindow
{
public static string binpath = Directory.GetCurrentDirectory() + @"\bin";
private bool forcedStop = false;
private string coreversion = "v0.2.4";
private string coreversion = "v0.2.5";

public MainWindow()
{
Expand Down

0 comments on commit 2ea3f9f

Please sign in to comment.