This is a complex topic. If the Python settings sufficed, one would
think that the line:
# -*- coding: utf-8 -*-
would never be needed. But it is. That being so, I think the prudent
thing is to require the same line in Leo scripts.
Edward
Now I investigate a bit, Python’s behaviour is stubborn and
arbitrary. When stdout is not a terminal then LC_CTYPE does not
determine sys.stdout.encoding. A consequence is
LC_CTYPE=en_GB.utf-8 python -c 'print u"\N{left-pointing double angle
quotation mark}"' works, but piping it through tee gives a UnicodeEncodeError.
Tracking down such "errors" (it is really just interface issues between processes, I guess) is very difficult. (But I will keep my eye out...)
And there are sufficiently simple work-arounds. I mention it simply to warn others about a possible trap. As long as you are working in ASCII, life is simple!