读取txt 文件编码问题 ANSI编码
- 编程
- 2021-09-01
- 1129
出现错误gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence”
解决办法:
with open(i, encoding='gb18030') as f:
encoding='gb18030' 添加这个编码 比GBK编码范围更广
出现错误gbk' codec can't decode byte 0xbf in position 2: illegal multibyte sequence”
解决办法:
with open(i, encoding='gb18030') as f:
encoding='gb18030' 添加这个编码 比GBK编码范围更广
发表评论