I can't get the console to print unicode characters using the Console.WriteLine or Console.Out.WriteLine
Searching the net, I got 2 suggestions for setting the encoding:
- Console.OutputEncoding = Encoding.UTF8;
- Console.WriteLine("Smiley face: ????");
-
- Console.OutputEncoding = System.Text.Encoding.UTF8;
- Console.WriteLine("Smiley face: ????");
Problem is that both these approaches give the same error below:
Smiley face: ????
Exception thrown: 'System.IO.IOException' in mscorlib.dll
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
The handle is invalid.
I have changed the console font to Lucida Console but still the unicode characters are not being printed
Environment:
IDE: VS Community version, 2017, Version 15.3.4
Windows 10