UnicodeDecodeError: 'gb18030' codec can't decode byte 0xff in position 0: illegal multibyte sequence
时间: 2023-12-16 15:28:36 浏览: 190
invalid multibyte character sequence 870告警1
```python
# 你可以通过指定编码方式来解决UnicodeDecodeError错误
with open('file.html', 'r', encoding='gb18030') as f:
content = f.read()
print(content)
```
```shell
# 你也可以使用chardet库来检测文件的编码格式
pip install chardet
```
阅读全文