I need to include a copyright statement at the top of every Python source file I produce:
# Copyright: © 2008 etc.
However, when I then run such a file I get this message:
SyntaxError: Non-ASCII character '\xa9' in file MyFile.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details.
Apparently Python isn't happy about the copyright symbol because it assumes the source file is all in ASCII. Either I need to make my first line be:
# -*- coding: iso-8859-1 -*-
to tell Python I'm using Latin encoding, or I can change the copyright statement to:
# Copyright: \xa9 2008 etc.
which just possibly doesn't have the same legal standing.
Is there a more elegant solution?