在树莓派下遇到unicode的问题
dawncold opened this issue · comments
♥ Get local token - Username: tradeoff
♥ Get channel [ OK ]
♥ Get volume [ OK ]
♥ Get theme [ OK ]
♥ Get keys [ OK ]
Exception in thread Thread-3:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/doubanfm/player.py", line 192, in _watchdog_queue
self.start(self.queue.get_song()['url'])
File "/usr/local/lib/python2.7/dist-packages/doubanfm/controller/main_controller.py", line 81, in _func
self.view.display()
File "/usr/local/lib/python2.7/dist-packages/doubanfm/views/main_view.py", line 59, in display
print '\n'.join(self.display_lines)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2192' in position 149: ordinal not in range(128)
Exception in thread Thread-7:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 505, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/doubanfm/controller/main_controller.py", line 199, in _watchdog_time
self.view.display()
File "/usr/local/lib/python2.7/dist-packages/doubanfm/views/main_view.py", line 59, in display
print '\n'.join(self.display_lines)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2192' in position 149: ordinal not in range(128)
但在ubuntu 14.04下未遇到
这和我的locale
设置有关,我后来把en_US.UTF8作为默认,重启后已经可以正常使用