I am a new python begginer and I have a confusing problem.
I use pydev for my applications and when I run application from eclipse It works great BUT when I run it with original Python IDE, I got the error message below:
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3"
I could not understand what I am doing wrong, please help me as soon as possible
(In my applications unicode is a MUST because of my language :) )
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did it but it did not help. After a research I learnt something and changed my "site.py" file. I just changed the default character encoding from ascii to utf8. It solved everything and I have no problem now. However, I dont know what this dangerous change will bring :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am a new python begginer and I have a confusing problem.
I use pydev for my applications and when I run application from eclipse It works great BUT when I run it with original Python IDE, I got the error message below:
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3"
I could not understand what I am doing wrong, please help me as soon as possible
(In my applications unicode is a MUST because of my language :) )
You will want to add this line to the top of your files:
# -*- coding: utf-8 -*-
If you have the normal shbang at the top (#!/usr/bin/...) then add it right after that
You may also want to check out http://evanjones.ca/python-utf8.html
-Brandon
Thanks Brandon
I did it but it did not help. After a research I learnt something and changed my "site.py" file. I just changed the default character encoding from ascii to utf8. It solved everything and I have no problem now. However, I dont know what this dangerous change will bring :)
When in doubt, you might try:
import sys
print sys.stdout.encoding