# 读取目标文件
try:
with open(file_path, 'r', encoding='UTF-8') as f:
str_ori = f.read()
except:
with open(file_path, 'r', encoding='gb18030', errors='ignore') as f:
str_ori = f.read()
finally:
if f in locals():
f.close()
'gbk' codec can't decode byte ... 的解决办法
最新推荐文章于 2024-06-28 17:00:50 发布