.:Slavus

Python source file encoding hint

Submitted by slavus on 2008-12-16 10:59:49  

Python source file encoding hint

When I program in Python I have bad habit writing comments in Croatian. When using characters like šđčžž i get some stupid errors. Some thing like this:

SyntaxError: Non-ASCII character 'xc4' in file

I know I have write first special comment, to tell Python I am writing in UTF-8., but I always forget what exactly I have to write. So here it is:

# -*- coding: utf-8 -*-

» Tags python   » Show comments(0)

Komentirajte