I have a c# console application that needs input that contains characters like "ä", "ö" or "å". But these characters drop out of the input. For example if the user input is "abc äöå" it is delivered to the program as "abc " an anyone help?
CodePudding user response:
You can change encoding as per below snippet code:
Console.OutputEncoding = Console.InputEncoding = Encoding.Unicode;
Console.Write("سلام بر برنامه نویس عزیز");
string name = Console.ReadLine();
Console.WriteLine($"اسم {name}");
And the output:
For more information check How to use character encoding classes in .NET