-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set .net compilation output stream to utf8 #73861
Conversation
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages
@@ -50,7 +50,7 @@ public static class BuildSystem | |||
process.OutputDataReceived += (_, e) => stdOutHandler.Invoke(e.Data); | |||
if (stdErrHandler != null) | |||
process.ErrorDataReceived += (_, e) => stdErrHandler.Invoke(e.Data); | |||
|
|||
process.StartInfo.StandardOutputEncoding = Encoding.UTF8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better defined together with other startInfo
properties before it's passed to the Process
constructor:
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.StandardOutputEncoding = Encoding.UTF8;
startInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"]
= ((string)editorSettings.GetSetting("interface/editor/editor_language")).Replace('_', '-');
Same for the other one below.
@@ -61,7 +62,7 @@ public static string FindDotNetExe() | |||
process.StartInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"] = "en-US"; | |||
|
|||
var lines = new List<string>(); | |||
|
|||
process.StartInfo.StandardOutputEncoding = Encoding.UTF8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for the other file, define this directly in the ProcessStartInfo
constructor instead of setting it up after the fact and between the definition and use of lines
.
using Process process = new Process();
process.StartInfo = new ProcessStartInfo(dotNetExe, "--list-sdks")
{
UseShellExecute = false,
RedirectStandardOutput = true,
StandardOutputEncoding = Encoding.UTF8
};
Could you squash the commits? And make sure to use the more explicit commit message for the squashed commit (like "Set .NET compilation output stream to UTF-8". See PR workflow for instructions. |
OK, I'll give it a try. This is my first PR submission. Many processes do not understand |
Let me know if you need help. I can also update the PR myself, but if you're interested it's a good opportunity to learn Godot's PR workflow and some Git tricks. |
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages
I changed the code and tried to merge, was it successful? |
After squashing the commits, you should actually have force pushed ( Here's a branch with the commits squashed and a couple unnecessary formatting changes removed: |
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages .net build_log utf8 Set the .net compilation output stream to utf8 to prevent garbled characters in other languages Set .net compilation output stream to utf8 Set .net compilation output stream to utf8 Set the .net compilation output stream to utf8 to prevent garbled characters in other languages
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages .net build_log utf8 Set the .net compilation output stream to utf8 to prevent garbled characters in other languages Set .net compilation output stream to utf8 Set .net compilation output stream to utf8 Set the .net compilation output stream to utf8 to prevent garbled characters in other languages .net build_log utf8 Set the .net compilation output stream to utf8 to prevent garbled characters in other languages Set .net compilation output stream to utf8
It's a bit of a crash, and the number of submissions is increasing. Please help me with this PR. I should learn how to use github |
Superseded by #73865. |
Thanks |
Set the .net compilation output stream to utf8 to prevent garbled characters in other languages