From 1c14f5ea88ffabb693497bc7ac39c507f981d597 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 19 Mar 2024 15:43:47 +0800 Subject: [PATCH] linux: force using en_US.UTF-8 locale to avoid GCM crash --- src/Commands/Command.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Commands/Command.cs b/src/Commands/Command.cs index 2fa42b1a..ce0afcab 100644 --- a/src/Commands/Command.cs +++ b/src/Commands/Command.cs @@ -41,6 +41,12 @@ namespace SourceGit.Commands start.StandardOutputEncoding = 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; var errs = new List();