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

后端 未结 2 745
无人共我
无人共我 2020-12-15 17:07

I\'m working on a small application using Google App Engine which makes use of the Quora RSS feed. There is a form, and based on the input entered by the user, it will outpu

相关标签:
2条回答
  • 2020-12-15 17:40

    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')
    
    0 讨论(0)
  • 2020-12-15 17:55

    In my AppEngine app, I convert it like:

    content = unicode(content)
    

    I think it more clear and easy to use.

    0 讨论(0)
提交回复
热议问题