Questions

UnicodeEncodeError at /admin/questions/question/1/change/ ‘ascii’ codec can't encode character u'\u2018' in position 38: ordinal not in range(128)

0

Internal Server Error: /admin/questions/question/1/change/

UnicodeEncodeError at /admin/questions/question/1/change/ ‘ascii’ codec can’t encode character u’\u2018’ in position 38: ordinal not in range(128)

unicode error



asked 1 year, 11 months ago
Reputation: 1





1 Answer

0

The error is coming because the environment is unable to decode the unicode characters.

In my case, I was getting this error after deploying to heroku.

We need to set default encoding to be utf-8. Set it as default on top of project’s wsgi.py file.

project wsgi.py

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

answered 1 year, 11 months ago
Reputation: 1





Your Answer

Nothing to preview

Post Answer



Asked:  1 year, 11 months ago
Viewed:  656 times
Active:  1 year, 11 months ago