Yes, encoding is a ...complex beast.
I have Googled a bit, and this post
(http://drj11.wordpress.com/2007/05/14/python-how-is-sysstdoutencoding-chosen/)
gives the flavor of the problem:
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<http://www.opengroup.org/onlinepubs/009695399/utilities/tee.html>gives a
UnicodeEncodeError.
My guess is that somewhere in Leo (something used by the leoscreen plugin in
particular) there is sys.stdout but not sys.sdout.encoding. Or, more
probably, it is piping to something that can't take the encoding from
python, so python throws an error.
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!
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/leo-editor/-/25Dibr9-s9cJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.