[Solved] UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
生活随笔
收集整理的這篇文章主要介紹了
[Solved] UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1. with open(path, 'rb') as f:contents = f.read()2. with open(path, encoding="utf8", errors='ignore') as f:3. with open(your_file_path,'rb') as f:contents = f.read()contents = contents.decode("utf-16")
總結
以上是生活随笔為你收集整理的[Solved] UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xff in position 0: invalid start byte的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 16. Leetcode 845. 数组
- 下一篇: 21. Leetcode 203. 移除