python转码报错decoding Unicode is not supported

    xiaoxiao2021-12-12  2

    PythonUnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 937: ordinal not in range(128) Logged from file scraper.py,

    u = unicode("辣", "utf-8") unicode(u'foo', 'utf-8') 以上这种转码方式可能会报错,如果报错请使用一下这种,在字符串后面添加 encode("utf-8")

    result = google.searchGoogle(param).encode("utf-8")

    转载请注明原文地址: https://ju.6miu.com/read-900182.html

    最新回复(0)