My configuration: Win7 + Python 2.6 + eclipse + PyDev
How do I enable Unicode print statements in:
Example print statement:
print(u"שלום עולם")
This comes out as:
ùìåí òåìí
For eclipse unicode console support:
-Dfile.encoding=UTF-8
to eclipse.ini
which is in the eclipse install directory.Run\Run Configurations\Python Run\configuration\Common\
make sure UTF-8 is selectedWindow\Preferences\General\Workspace\Text file encoding\
making sure UTF-8 is selected[python install path]\Lib\site.py
- change from encoding = "ascii"
to encoding = "utf-8"
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With