mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix Windows version detection for UTF-8 console
Built-in Environment.OSVersion does not work on Win10.
This commit is contained in:
parent
176bbccd50
commit
26716512c1
4 changed files with 100 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ using System.Reflection;
|
|||
using System.Threading;
|
||||
using MinecraftClient.Protocol.Handlers.Forge;
|
||||
using MinecraftClient.Protocol.SessionCache;
|
||||
using MinecraftClient.WinAPI;
|
||||
|
||||
namespace MinecraftClient
|
||||
{
|
||||
|
|
@ -49,7 +50,7 @@ namespace MinecraftClient
|
|||
}
|
||||
|
||||
//Take advantage of Windows 10 / Mac / Linux UTF-8 console
|
||||
if (Environment.Version.Major > 6 || isUsingMono)
|
||||
if (isUsingMono || WindowsVersion.WinMajorVersion >= 10)
|
||||
{
|
||||
Console.OutputEncoding = Console.InputEncoding = Encoding.UTF8;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue