For eclipse unicode console support:
- Add
-Dfile.encoding=UTF-8
toeclipse.ini
which is in the eclipse install 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\
making sure UTF-8 is selected - In
[python install path]\Lib\site.py
– change fromencoding = "ascii"
toencoding = "utf-8"
- Make sure you’re using unicode supporting fonts in eclipse –
Window\Preferences\Appearance\Colors and Fonts\Debug\Console font\Edit
In the installation I did all of the above:
print(u"שלום עולם") # Doesn't work
print("שלום עולם") # Works
For django models:
print(my_model.my_field) # Doesn't work
print(my_model.my_field.encode('utf-8')) # Works