Is there a way to write Hebrew in a Windows console?

Is there a way to write Hebrew in a Windows console?

I tried the following:

Console.OutputEncoding = new UTF8Encoding(false); Console.WriteLine("\u05D0\u05D1"); Console.ReadLine(); 

but instead of "אב" he spells some other Unicode character that is not in the Jewish ABC.

Any ideas why?

+6
unicode console utf-8 hebrew
source share
5 answers

If you can invoke the chcp command chcp front of your program, you can change the code page to Hebrew, and then your characters will be readable. There is an interesting article on internationalization and the Windows console here: http://illegalargumentexception.blogspot.com/2009/04/i18n-unicode-at-windows-command-prompt.html

+3
source share

Just change the OutputEncoding:

 Console.OutputEncoding = Encoding.GetEncoding("Windows-1255"); 
+2
source share
  Console.OutputEncoding = new UTF8Encoding(); Console.WriteLine("\u05D0\u05D1"); Console.WriteLine("ΧΧ¨Χ™ΧΧœ"); Console.WriteLine(new string("ΧΧ¨Χ™ΧΧœ".Reverse().ToArray())); 

works for me, maybe it's just removing the β€œfalse”? it works on my machine, except for oc it writes letters back if I do not use reverse

Perhaps you need to install the registry? run β†’ regedit and do the following: http://blogs.microsoft.co.il/technet/2013/06/11/%D7%90%D7%99%D7%9A-%D7%90%D7%A4%D7 % A9% D7% A8-% D7% 9C% D7% A8% D7% 90% D7% 95% D7% AA-% D7% A2% D7% 91% D7% A8% D7% 99% D7% AA-% D7% 91-powershell-console /

in the rightclick registry window, select a new row.

+1
source share

Correct me if I am wrong, but I do not think the console supports UTF8.

0
source share

If you just want it for short testing purposes, and not for creating an entire application, just use Debug.WriteLine , which supports unicode (checked only with heb characters).

0
source share

All Articles