Read Text File Returns Unicodedecodeerror: 'utf-8' Codec Can't Decode Byte 0x92 In Python
I'm reading a text file using Python3 even I have mentioned encoding but it retruns: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 96: invalid start byte
Solution 1:
Your textfile probably isn't encoded in utf-8. You might want to try a different encoding, e.g. encoding='cp1252'
Solution 2:
According to Exceen's answer on a related question, that's a "smart quote" in the Win-1252 encoding.
Baca Juga
- Json Library Interprets Space Characters As "\xa0"
- Reading Csv File Into Pandas From Sftp Server Via Paramiko Fails With "'utf-8' Codec Can't Decode Byte ... In Position ....: Invalid Start Byte"
- Why The Model Is Training On Only 1875 Training Set Images If There Are 60000 Images In The Mnist Dataset?
Post a Comment for "Read Text File Returns Unicodedecodeerror: 'utf-8' Codec Can't Decode Byte 0x92 In Python"