Skip to content
This repository has been archived by the owner on Jan 11, 2021. It is now read-only.

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 22: ordinal not in range(128) #44

Closed
watsy0007 opened this issue Nov 27, 2013 · 2 comments

Comments

@watsy0007
Copy link

In my team, We speak chinese. So, I must write chinese comment.
When i write comment in view's functions.(list, create, destroy ...)
I Got
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 22: ordinal not in range(128)

@watsy0007
Copy link
Author

In introspectors.py
I add

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

fix it.

@chrisberragan
Copy link

I think adding this to the top of your .py file might be a better solution:

# -*- coding: utf-8 -*-

From: http://stackoverflow.com/a/10062172

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants