How to write Unicode characters to the console?

后端 未结 5 1966
无人及你
无人及你 2020-11-22 00:27

I was wondering if it was possible, in a console application, to write characters like using .NET. When I try to write this character, the console outputs a q

5条回答
  •  情书的邮戳
    2020-11-22 01:02

    This works for me:

    Console.OutputEncoding = System.Text.Encoding.Default;

    To display some of the symbols, it's required to set Command Prompt's font to Lucida Console:

    1. Open Command Prompt;

    2. Right click on the top bar of the Command Prompt;

    3. Click Properties;

    4. If the font is set to Raster Fonts, change it to Lucida Console.

提交回复
热议问题