I was debugging a Python 3 script and every time I tried to print a variable, it gave me the following error:
ipdb> inputs
*** UnicodeEncodeError: 'ascii' codec can't encode character '\u22f1' in
position 314: ordinal not in range(12)
I tried to set the default encoding to UTF-8 using sys.setdefaultencoding()
and adding # -*- coding: utf-8 -*-
at the top of the script, but both didn't work.