How to write Unicode characters to the console?

后端 未结 5 1853
无人及你
无人及你 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:00

    Besides Console.OutputEncoding = System.Text.Encoding.UTF8;

    for some characters you need to install extra fonts (ie. Chinese).

    In Windows 10 first go to Region & language settings and install support for required language:

    After that you can go to Command Prompt Proporties (or Defaults if you like) and choose some font that supports your language (like KaiTi in Chinese case):

    Now you are set to go:

提交回复
热议问题