使用python2 总是遇到

UnicodeDecodeError
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 37: ordinal not in range(128)

 

尝试 decode  encode 也没有用,

最后 在代码当中 引入模块部分 加入如下 几句,就解决了问题

 

import sys
reload(sys)
sys.setdefaultencoding('utf-8')

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-10-08
猜你喜欢
  • 2021-09-25
  • 2021-05-10
  • 2021-06-06
  • 2021-07-24
  • 2021-08-01
  • 2021-07-24
  • 2022-01-05
相关资源
相似解决方案