Python, how to print Japanese, Korean, Chinese strings

前端 未结 5 1881
情书的邮戳
情书的邮戳 2021-01-13 12:55

In Python, for Japanese, Chinese, and Korean,Python can not print the correct strings, for example hello in Japanese, Korean and Chinese are:

こん         


        
5条回答
  •  太阳男子
    2021-01-13 13:32

    I was also bothered by the same problem.
    It is certainly the limitation of the font you are using.
    It is set to "Consolas" by default.

    You can change it to "MS Gothic" or "NSimSun". I personally prefer the latter. Both of them are capable of displaying Japanese/Chinese characters, but ensure that your system encoding is set to utf-8 as mentioned by sami in the above answer.

    To change font in cmd, do:

    1. Click on the cmd icon on top left of cmd window.
    2. A drop-down menu appears. Select properties.
    3. Select the font you prefer from the list shown in the second section.
    4. Click OK.

提交回复
热议问题