Saturday, December 20, 2008

Python Encoding

Python uses UTF-8 for encoding python files. But for some reason Google App Engine does not.

You MUST include this right in the very first line of your .py file:

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


Remember the it MUST be in the very first line of the text so the encoding comment: # -*- coding: utf-8 -*-
Will be positioned exactly in the 2nd line with is mandatory according to Python specification.

Hope it helps.

No comments:

Post a Comment