From 880cd7b8bacfcee2cc6a8e15b6b8ea5e05e9467c Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 28 Jul 2021 21:20:44 -0400 Subject: fix handling of Unicode characters in console --- src/SMAPI/Framework/Logging/LogManager.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/SMAPI/Framework/Logging/LogManager.cs') diff --git a/src/SMAPI/Framework/Logging/LogManager.cs b/src/SMAPI/Framework/Logging/LogManager.cs index 2cd512e0..e16b5c0d 100644 --- a/src/SMAPI/Framework/Logging/LogManager.cs +++ b/src/SMAPI/Framework/Logging/LogManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; +using System.Text; using System.Text.RegularExpressions; using System.Threading; using StardewModdingAPI.Framework.Commands; @@ -106,6 +107,10 @@ namespace StardewModdingAPI.Framework.Logging if (writeToConsole) output.OnMessageIntercepted += message => this.HandleConsoleMessage(this.MonitorForGame, message); Console.SetOut(output); + + // enable Unicode handling + Console.InputEncoding = Encoding.Unicode; + Console.OutputEncoding = Encoding.Unicode; } /// Get a monitor instance derived from SMAPI's current settings. -- cgit