问题描述
我想要这个代码:
c> $ 默认设置为西欧(DOS)( CodePage 设置为850和 WindowsCodePage 设置为1252)。字符集包含特殊的OE和oe diphtong(如可在),但不知何故,我怀疑 set get aband / replaced。
字符如â, ç等正确显示在控制台上,但扩展的0x80 ... 0x9F范围内的任何字符都不是。
如何
<$>解决方案 p $ p> Console.OutputEncoding = System.Text.Encoding.UTF8;
System.Console.Out.WriteLine(œil);
不要忘记为您的控制台窗口选择支持所需字符的字体。这是我使用Consolas字体的控制台窗口的屏幕截图。
I would like to have this code:
System.Console.Out.WriteLine ("œil");display œil instead of oil as it does in my test program.
The Console.OutputEncoding is set by default to Western European (DOS) (CodePage set to 850 and WindowsCodePage set to 1252) on my system. The character set contains the special OE and oe diphtongs (as can be seen on the Wikipedia article on Windows-1252) but somehow, I suspect that the characters not found in the ISO-8859-1 set get discarded/replaced.
Characters such as â, ç, etc. get properly displayed on the console, but any character in the extended 0x80 ... 0x9F range are not.
How can I properly display them on the console?
解决方案Like this:
Console.OutputEncoding = System.Text.Encoding.UTF8; System.Console.Out.WriteLine("œil");Don't forget to select a font for your console window that supports the characters you need. This is a screen shot of my console window using the Consolas font.
这篇关于如何将特殊字符(0x80..0x9F)写入Windows控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
08-05 22:42