1

I know there are lots of similar questions, but none seem to answer my question.

Getting this error:

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

If I test to print that character, it 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" for more information. >>> print('\xe5') å >>> print('å') å 

If I add .encode('utf-8') it just outputs Dimming b'Byr\xc3\xa5' to 100

This is a process running on Ubuntu via Upstart. How can I make it output the correct character?

1 Answer 1

2

Add env LANG=en_US.UTF-8 to the Upstart script conf file.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.