My terminal is iso-8859-1, so yes my first example worked.
My second example was misguided. It was meant to demonstrate that Python does sometimes obey the value of LANG. However, it turns out to be complaining about the output, not the input. In this case it looks like python is defaulting to a source encoding of iso-8859-1.
However, that only applies for programs executed via "-c"; the default for source read from a file seems to be ASCII (unless the file starts with a UTF-8 byte-order mark).
$ cat moose.py
#!/usr/bin/python
print u"møøse"
$ LANG=en_GB.ISO8859-1 python moose.py
File "moose.py", line 2
SyntaxError: Non-ASCII character '\xf8' in file moose.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
no subject
My second example was misguided. It was meant to demonstrate that Python does sometimes obey the value of LANG. However, it turns out to be complaining about the output, not the input. In this case it looks like python is defaulting to a source encoding of iso-8859-1.
However, that only applies for programs executed via "-c"; the default for source read from a file seems to be ASCII (unless the file starts with a UTF-8 byte-order mark).