How can the user be able to write Hebrew Characters in console window which appears now to show question marks, This is what I Have:
Encoding hebrewEncoding = Encoding.GetEncoding("Windows-1255");
Console.InputEncoding = Encoding.GetEncoding("Windows-1255");
Console.WriteLine("Write your input:");
string Input = Console.ReadLine();
Simply changed InputEncoding to OutputEncoding:
Console.OutputEncoding = Encoding.GetEncoding("Windows-1255");
First make sure you set the registry like explained here : איך אפשר לראות עברית ב
run -> regedit --rightclick choose new string.
After that Try this instead :
Console.OutputEncoding = new UTF8Encoding();
Console.InputEncoding = new UTF8Encoding();
Console.WriteLine("Write your input:");
string Input = Console.ReadLine();
If you want output only :
//It will display hebrew letter to console
Console.OutputEncoding = new UTF8Encoding();
Console.WriteLine("\u05D0\u05D1");
Console.WriteLine("אריאל");
Console.WriteLine(new string("אריאל".Reverse().ToArray()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With