Fix encoding for Windows 7/8

Old CMD.exe does not handle UTF-8,
so UTF-8 is enabled only on Windows 10 and Mono.
This commit is contained in:
ORelio 2018-02-09 21:42:46 +01:00
parent ab13a63ba1
commit 6e1ee784d8

View file

@ -47,7 +47,12 @@ namespace MinecraftClient
ConsoleIO.basicIO = true;
args = args.Where(o => !Object.ReferenceEquals(o, args[args.Length - 1])).ToArray();
}
Console.OutputEncoding = Console.InputEncoding = Encoding.UTF8;
//Take advantage of Windows 10 / Mac / Linux UTF-8 console
if (Environment.Version.Major > 6 || isUsingMono)
{
Console.OutputEncoding = Console.InputEncoding = Encoding.UTF8;
}
//Process ini configuration file
if (args.Length >= 1 && System.IO.File.Exists(args[0]) && System.IO.Path.GetExtension(args[0]).ToLower() == ".ini")