i am developing a plugin for getting rss from a website which is utf-8, when loading the code from the site, i got these error:
<type 'exceptions.UnicodeDecodeError'>: 'ascii' codec can't decode byte 0xe5 in position 9
here is the code what i used before:
title = entry_rss.title.encode('UTF-8')
then i use these code to resolve this issue:
title = entry_rss.title.encode('UTF-8')
title = unicode(title, "utf-8")
title = unicode(title, "utf-8")
Have fun with python!
本文讨论了在开发插件时遇到的网页编码问题,通过使用合适的方法解决了'ascii' codec无法解码字节的问题,并提供了相应的代码示例。
5793

被折叠的 条评论
为什么被折叠?



