Skip to content

Commit

Permalink
imp - Always set output encoding to UTF8 on init
Browse files Browse the repository at this point in the history
---

For Windows systems, we need to initialize the codepage to UTF8 before trying to start anything. This is to take full advantage of all the font glyphs, such as the PowerLine glyphs.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 26, 2024
1 parent ad7c93c commit d4d4e1e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/Nitrocid/Kernel/Starting/KernelInitializers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
using Nitrocid.Network.SpeedDial;
using Nitrocid.Network.Connections;
using Terminaux.Base.Extensions;
using System.Text;

namespace Nitrocid.Kernel.Starting
{
Expand All @@ -79,11 +80,15 @@ internal static void InitializeCritical()
// Initialize crucial things
if (!KernelPlatform.IsOnUnix())
{
// Initialize the VT sequences
if (!ConsolePositioning.InitializeSequences())
{
TextWriterColor.Write(Translate.DoTranslation("Can not initialize VT sequences for your Windows terminal. Make sure that you're running Windows 10 or later."));
InputTools.DetectKeypress();
}

// Set the codepage
Console.OutputEncoding = Encoding.UTF8;
}

// Load the assembly resolver
Expand Down

0 comments on commit d4d4e1e

Please sign in to comment.