Python :- UnicodeEncodeError: 'charmap' codec can't encode character u'\u2014' in position

No replies
Joined: 02/04/2015

Question received by our support team:
I am running my script in python.
Running the code shows this error when it fails to switch from the default ASCII to other encoding such as UTF-8.

The answer
You can try following -

- import sys
- reload(sys)
- sys.setdefaultencoding("utf-8")

You can find more detail about this issue on below link -

Note :- - Ensure you are using latest version of Python.