When to use utf8 as a header in py files

wherever you need to use in your code chars that aren’t from ascii, like:

ă 

interpreter will complain that he doesn’t understand that char.

Usually this happens when you define constants.

Example:
Add into x.py

print 'ă'

then start a python console

import x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "x.py", line 1
 SyntaxError: Non-ASCII character '\xc4' in file x.py on line 1, 
   but no encoding declared;
   see http://www.python.org/peps/pep-0263.html for details

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)