Skip to content

Commit f3c80d9

Browse files
authored
Fixes #4136. NetDriver and v2net are rendering badly the Button only in `Windows (#4137)
1 parent 23cc44c commit f3c80d9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Terminal.Gui/Drivers/NetDriver/NetDriver.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// NetDriver.cs: The System.Console-based .NET driver, works on Windows and Unix, but is not particularly efficient.
44
//
55

6-
using System.Collections.Concurrent;
7-
using System.Diagnostics;
8-
using System.Diagnostics.CodeAnalysis;
96
using System.Runtime.InteropServices;
107
using static Terminal.Gui.Drivers.NetEvents;
118

@@ -232,6 +229,8 @@ void WriteToConsole (StringBuilder output, ref int lastCol, int row, ref int out
232229
/// <inheritdoc />
233230
public override MainLoop Init ()
234231
{
232+
Console.OutputEncoding = Encoding.UTF8;
233+
235234
PlatformID p = Environment.OSVersion.Platform;
236235

237236
if (p == PlatformID.Win32NT || p == PlatformID.Win32S || p == PlatformID.Win32Windows)

Terminal.Gui/Drivers/V2/NetOutput.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public NetOutput ()
2222
{
2323
Logging.Logger.LogInformation ($"Creating {nameof (NetOutput)}");
2424

25+
Console.OutputEncoding = Encoding.UTF8;
26+
2527
PlatformID p = Environment.OSVersion.Platform;
2628

2729
if (p == PlatformID.Win32NT || p == PlatformID.Win32S || p == PlatformID.Win32Windows)

0 commit comments

Comments
 (0)