问题描述
我正在使用Python脚本,该脚本返回BBC目前正在播放/正在播放的DJ。以为它没有错误,但是现在我发现如果输出中有(奇怪的)撇号“’”,它就会失败。我可以以某种方式解决此问题吗?
exit code: 1,Traceback (most recent call last):
File "script2.py",line 17,in <module>
print g_data[5].text
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 7: ordinal not in range(128)
这是输出
Clara Amfo
Radio 1 Dance
Ace
Ken Bruce
Essential Classics
Hip-hop’s Laughing Stock
Desert Island discs Revisited
The emma Barnett Show
Cricket
Mary Anne Hobbs
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)