Google App Engine: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 48: ordinal not in range(128)

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 01:02:31

Python is likely trying to decode a unicode string into a normal str with the ascii codec and is failing. When you're working with unicode data you need to decode it:

content = content.decode('utf-8')

In my AppEngine app, I convert it like:

content = unicode(content)

I think it more clear and easy to use.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!