I am trying to create a C # console application with Visual Studio 2010 in English Windows 7 Ultimate 64-bit. When I try to copy a path with non-ASCII characters and then paste it into the console application, non-ASCII characters will turn into ???. Is there any way to fix this?
Here is what I copy: C:\Test Folder\
And this is the code (after the suggested link above):
Console.OutputEncoding = System.Text.Encoding.UTF8;
string strLineUserInput = Console.ReadLine();
But even if I change the font, it C:\Test Folder\still becomes C:\Test Folder\?????????in the variable strLineUserInputwhen I test it with the debugger.
Also note that unlike the "duplicate post" link, I need these characters in the input.
So, if I do this, then:
Console.InputEncoding = System.Text.Encoding.UTF8;
string strLineUserInput = Console.ReadLine();
My strLineUserInputbecomes nullif I read the text above.