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

后端 未结 5 1538
再見小時候
再見小時候 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:12

    Since Python 3.7.x, You can reconfigure stdout :

    import sys
    sys.stdout.reconfigure(encoding='utf-8')
    

提交回复
热议问题