I'm trying to build a console C# application with Visual Studio 2010 on the English Windows 7 Ultimate 64-bit. When I try to copy a path with non-ASCII characters and then paste it into my console app the non-ASCII characters turn into ???. Is there any way to fix this?
Here's what I'm copying: C:\Test Folder\документи
And this is the code (after a suggested link above):
Console.OutputEncoding = System.Text.Encoding.UTF8;
string strLineUserInput = Console.ReadLine();
But even if I change the font, the C:\Test Folder\документи
still becomes C:\Test Folder\?????????
in strLineUserInput
variable when I test it with a debugger.
Also note that unlike the link "duplicate post", I need these characters on the input.
So if I do this then:
Console.InputEncoding = System.Text.Encoding.UTF8;
string strLineUserInput = Console.ReadLine();
My strLineUserInput
becomes null
if I read the text above.