summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-07 12:08:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-07 12:08:46 +0200
commitec999b24ee7388bb6beeaad88af34dc40fc7ed03 (patch)
treec9952a0a9380811af7207eb120bbabad75f1cf2e
parent828ec2c5d005b6499c7c4c88beaf81767d05614b (diff)
parente0efa3c3577795d5b5dbeef6e35b9fd74e61aa3d (diff)
downloadredot-engine-ec999b24ee7388bb6beeaad88af34dc40fc7ed03.tar.gz
Merge pull request #74065 from RedworkDE/net-dotnet-encoding
C#: Always decode `dotnet` output as UTF-8
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs12
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Build/DotNetFinder.cs6
2 files changed, 18 insertions, 0 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
index d550c36b82..d7d484d166 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildSystem.cs
@@ -41,6 +41,12 @@ namespace GodotTools.Build
startInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"]
= ((string)editorSettings.GetSetting("interface/editor/editor_language")).Replace('_', '-');
+ if (OperatingSystem.IsWindows())
+ {
+ startInfo.StandardOutputEncoding = Encoding.UTF8;
+ startInfo.StandardErrorEncoding = Encoding.UTF8;
+ }
+
// Needed when running from Developer Command Prompt for VS
RemovePlatformVariable(startInfo.EnvironmentVariables);
@@ -105,6 +111,12 @@ namespace GodotTools.Build
startInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"]
= ((string)editorSettings.GetSetting("interface/editor/editor_language")).Replace('_', '-');
+ if (OperatingSystem.IsWindows())
+ {
+ startInfo.StandardOutputEncoding = Encoding.UTF8;
+ startInfo.StandardErrorEncoding = Encoding.UTF8;
+ }
+
// Needed when running from Developer Command Prompt for VS
RemovePlatformVariable(startInfo.EnvironmentVariables);
diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/DotNetFinder.cs b/modules/mono/editor/GodotTools/GodotTools/Build/DotNetFinder.cs
index b437c7e742..cfe79cf3e1 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Build/DotNetFinder.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Build/DotNetFinder.cs
@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
+using System.Text;
using JetBrains.Annotations;
using OS = GodotTools.Utils.OS;
@@ -58,6 +59,11 @@ namespace GodotTools.Build
RedirectStandardOutput = true
};
+ if (OperatingSystem.IsWindows())
+ {
+ process.StartInfo.StandardOutputEncoding = Encoding.UTF8;
+ }
+
process.StartInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"] = "en-US";
var lines = new List<string>();