Unicode printing in the pycl and standby eclipse console

My configuration: Win7 + Python 2.6 + eclipse + PyDev

How to enable Unicode print instructions in:

  • PyDev console in eclipse
  • Idle Python GUI

Example of a print statement:

print(u"שלום עולם")

It looks like:

ùìåí òåìí
+5
source share
3 answers

To support the unicode eclipse console:

  • Add -Dfile.encoding=UTF-8to eclipse.ini, which is located in the eclipse installation directory.
  • In eclipse - Run\Run Configurations\Python Run\configuration\Common\make sure UTF-8 is selected
  • In eclipse - Window\Preferences\General\Workspace\Text file encoding\make sure UTF-8 is selected
  • B [python install path]\Lib\site.py- go from encoding = "ascii"toencoding = "utf-8"
  • Make sure you use unicode supporting fonts in eclipse - Window\Preferences\Appearance\Colors and Fonts\Debug\Console font\Edit

During the installation process, I did all of the above:

print(u"שלום עולם")         # Doesn't work
print("שלום עולם")          # Works

django:

print(my_model.my_field)                 # Doesn't work
print(my_model.my_field.encode('utf-8')) # Works
+11

Eclipse Luna 4.0.4 Python 3.4.1 PyDev 3.6.0. , .

, , Eclipse PyDevPython Interpreter, PYTHONIOENCODING utf-8.

...

+4

PYTHONIOENCODING is a pretty good general way to solve this problem. However, the Eclipse way to install the locale of its console is as follows:

Set Run Configuration :

  • Change Run Configuration
  • Click on the "General" tab .
  • Set encoding "UTF-8"
0
source

All Articles