linux: force using en_US.UTF-8 locale to avoid GCM crash

This commit is contained in:
leo 2024-03-19 15:43:47 +08:00
parent abc97dce6c
commit 1c14f5ea88

View file

@ -41,6 +41,12 @@ namespace SourceGit.Commands
start.StandardOutputEncoding = Encoding.UTF8; start.StandardOutputEncoding = Encoding.UTF8;
start.StandardErrorEncoding = Encoding.UTF8; start.StandardErrorEncoding = Encoding.UTF8;
// Force using en_US.UTF-8 locale to avoid GCM crash
if (OperatingSystem.IsLinux())
{
start.Environment.Add("LANG", "en_US.UTF-8");
}
if (!string.IsNullOrEmpty(WorkingDirectory)) start.WorkingDirectory = WorkingDirectory; if (!string.IsNullOrEmpty(WorkingDirectory)) start.WorkingDirectory = WorkingDirectory;
var errs = new List<string>(); var errs = new List<string>();