代码:
def reqURL():
request = urllib.request.urlopen('https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat')
html = request.read()
html = html.decode(encoding="utf-8", errors="ignore")
print(html)
错误:
UnicodeEncodeError: 'charmap' codec can't encode character '\u017d' in position 468663: character maps to <undefined>
问题:
我阅读了docs并将errors="ignore"
放入我的代码中,但它无效!为什么呢?