在使用python时经常会遇到一些编码的错误

例如'gbk' codec can't decode byte 0xbe in position 18: illegal multibyte sequenc

python : 'gbk' codec can't decode byte 0xbe in position 18: illegal multibyte sequenc

源代码片段为

python : 'gbk' codec can't decode byte 0xbe in position 18: illegal multibyte sequenc

很明显从错误中我们可以指导,这是因为文本文档采用的是gbk编码,这个时候我们需要转换成python能识别的编码,比如utf-8

python : 'gbk' codec can't decode byte 0xbe in position 18: illegal multibyte sequenc
python : 'gbk' codec can't decode byte 0xbe in position 18: illegal multibyte sequenc

相关文章:

  • 2021-12-27
  • 2021-11-19
  • 2021-06-07
  • 2021-12-15
  • 2021-07-22
  • 2021-09-21
  • 2022-01-16
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-04-19
相关资源
相似解决方案