读写中文报错
Topic sourcetxt 文件里写了“你好,再见”,想用python读出来结果报错 (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 0: invalid start byte
file=open('abc.txt','r',encoding='utf-8')
file.read()
- 1
赏你个小费-不用找了
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)