Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence

Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence

解决办法:

在语句open(sFileName,newline='')中,增加encoding='UTF-8',如下:

open(sFileName,newline='',encoding='UTF-8')

posted on 2019-02-26 14:40  天道酬勤2016  阅读(2233)  评论(0编辑  收藏  举报