0

I use python 3.6.4 and , I run code below:

print ("你好")
print (u"你好")

but i get this:

enter image description here

However, if it run with VS code, it can print properly: 你好 你好

i google the problem, and find a lot suggestion:

  1. add #-*- coding: utf-8 -*- at the beginning
  2. encode and then decode
  3. chcp 65001 in console

, but no one work.

How to print chinese properly in window console ?

Marcus Wong
  • 341
  • 3
  • 15
  • Did u try this: https://stackoverflow.com/questions/2688020/how-to-print-chinese-word-in-my-code-using-python.. I tried to recreate this issue in Linux/Ubuntu, both of ur command works perfectly find in Ubuntu python3.6 – O_o Jun 10 '18 at 05:06
  • yes. I try that before. It print b'\xe5\x93\x88\xe5\x93\x88' . as python 3 default is utf-8 encoded. Yes it work fine in Ubuntu. It just suck in window console. – Marcus Wong Jun 10 '18 at 06:51

0 Answers0