“UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 2: invalid continuation byte”

我们在用python处理txt文件的时候,有时候因为编码的选择不当会出现下面的问题:

这个时候处理起来很简单,只需要在另存txt文件的时候选择使用“utf-8”编码即可,具体解决方案如下图所示:

猜你喜欢

转载自blog.csdn.net/qq_33221533/article/details/88792062