Add unicode-capable IO to hooke.ui.commandline.
The previous implementation produced:
$ python bin/hooke -c 'flat_filter_playlist'
...
hooke> Traceback (most recent call last):
...
UnicodeEncodeError: 'ascii' codec can't encode character u'\xec'...
The new encoding detection functions in hooke.util.encoding came from
my libbe.util.encoding module for Bugs Everywhere. From my original
BE commit (Tue 2008-11-25 15:47:19 -0500):
get_encoding() is from Trac
http://trac.edgewall.org/browser/trunk/trac/util/datefmt.py
format_datetime()
Trac has a BSD license
http://trac.edgewall.org/wiki/TracLicense
I don't know if such a small snippet requires us to "reproduce the
above copyright" or where we need to reproduce it if it is needed.
The stdout/stdin replacement code follows
http://wiki.python.org/moin/ShellRedirectionFails
References:
http://wiki.python.org/moin/Unicode
http://www.amk.ca/python/howto/unicode
http://www.python.org/dev/peps/pep-0100/