Printing Unicode in eclipse Pydev console and in Idle

前端 未结 3 1236
悲哀的现实
悲哀的现实 2020-12-03 06:39

My configuration: Win7 + Python 2.6 + eclipse + PyDev

How do I enable Unicode print statements in:

  1. PyDev console in eclipse
  2. Idle Python GUI
3条回答
  •  無奈伤痛
    2020-12-03 06:47

    I was having the a same problem in Eclipse Luna 4.0.4 with Python 3.4.1 and PyDev 3.6.0. I tried the steps given above, and a few others, and was getting nowhere.

    What worked for me was, in Eclipse, in Preferences —> PyDev —> Interpreters —> Python Interpreter, in the Environment tab, I added the environment variable PYTHONIOENCODING and specified its value as utf-8.

    That did the trick for me…

提交回复
热议问题