python 3.x - Print and UnicodeEncodeError -


i know there lots of similar questions, none seem answer question.

getting error:

print('dimming', device.name, 'to', level) unicodeencodeerror: 'ascii' codec can't encode character '\xe5' in position 3: ordinal not in range(128) 

if test print character, works:

$ python3 python 3.4.3 (default, oct 14 2015, 20:33:09) [gcc 4.8.4] on linux type "help", "copyright", "credits" or "license" more information. >>> print('\xe5') å >>> print('å') å 

if add .encode('utf-8') outputs dimming b'byr\xc3\xa5' 100

this process running on ubuntu via upstart. how can make output correct character?

add env lang=en_us.utf-8 upstart script conf file.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -