How to print utf-8 to console with Python 3.4 (Windows 8)?

后端 未结 5 1571
再見小時候
再見小時候 2020-12-29 03:58

I\'ve never fully wrapped my head around encoding and decoding unicode to other formats (utf-8, utf-16, ascii, etc.) but I\'ve reached a wall thatis both confusing and frust

5条回答
  •  一个人的身影
    2020-12-29 04:07

    Do not encode to utf-8; print Unicode directly instead:

    print(u'♠')
    

    See how to print Unicode to Windows console.

提交回复
热议问题