Fix command-line encoding processing.
authorW. Trevor King <wking@drexel.edu>
Fri, 8 Apr 2011 18:21:45 +0000 (14:21 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 8 Apr 2011 18:25:57 +0000 (14:25 -0400)
commit44cbfdc1e8e9c6c7fb115c7ea101e2532d58e436
tree7bce01eeb0bb131e1bd08a96d06fb64687affcbd
parent79c84af65d250b5a372693ac835f0730ca18edf3
Fix command-line encoding processing.

String command-line options are converted to unicode using the input
encoding.

We use the fact that Python sets up the original sys.stdout to
determine the terminal encoding.

This should fix Anders Sneckenborg's issues with Swedish characters:

  C:\temp\slask4>be new "Svenska tecken åäö"
  Created bug with ID 6be/5c3

  C:\temp\slask4>
  C:\temp\slask4>
  C:\temp\slask4>be list
  ERROR:
  'ascii' codec can't decode byte 0xe5 in position 15: ordinal not in
  range(128)
  You should set a locale that supports unicode, e.g.
    export LANG=en_US.utf8
  See http://docs.python.org/library/locale.html for details
libbe/ui/command_line.py
libbe/util/encoding.py