From f3c80d99e13cae0e53f08377f1cd729de3646dce Mon Sep 17 00:00:00 2001 From: BDisp Date: Mon, 9 Jun 2025 20:53:46 +0100 Subject: [PATCH] Fixes #4136. NetDriver and v2net are rendering badly the Button only in `Windows (#4137) --- Terminal.Gui/Drivers/NetDriver/NetDriver.cs | 5 ++--- Terminal.Gui/Drivers/V2/NetOutput.cs | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Terminal.Gui/Drivers/NetDriver/NetDriver.cs b/Terminal.Gui/Drivers/NetDriver/NetDriver.cs index e3b8760c3..fa2ccadd9 100644 --- a/Terminal.Gui/Drivers/NetDriver/NetDriver.cs +++ b/Terminal.Gui/Drivers/NetDriver/NetDriver.cs @@ -3,9 +3,6 @@ // NetDriver.cs: The System.Console-based .NET driver, works on Windows and Unix, but is not particularly efficient. // -using System.Collections.Concurrent; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using static Terminal.Gui.Drivers.NetEvents; @@ -232,6 +229,8 @@ internal class NetDriver : ConsoleDriver /// public override MainLoop Init () { + Console.OutputEncoding = Encoding.UTF8; + PlatformID p = Environment.OSVersion.Platform; if (p == PlatformID.Win32NT || p == PlatformID.Win32S || p == PlatformID.Win32Windows) diff --git a/Terminal.Gui/Drivers/V2/NetOutput.cs b/Terminal.Gui/Drivers/V2/NetOutput.cs index 33f0e9434..989aab735 100644 --- a/Terminal.Gui/Drivers/V2/NetOutput.cs +++ b/Terminal.Gui/Drivers/V2/NetOutput.cs @@ -22,6 +22,8 @@ public class NetOutput : IConsoleOutput { Logging.Logger.LogInformation ($"Creating {nameof (NetOutput)}"); + Console.OutputEncoding = Encoding.UTF8; + PlatformID p = Environment.OSVersion.Platform; if (p == PlatformID.Win32NT || p == PlatformID.Win32S || p == PlatformID.Win32Windows)