Answers for "utf-8 codec can't decode byte"


'utf-8' codec can't decode byte 0x85 in position 715: invalid start byte

import pandas as pd
data = pd.read_csv(filename, encoding= 'unicode_escape')
Posted by: Guest on March-19-2020

UnicodeDecodeError: 'utf-8' codec can't decode byte invalid start byte

# Use 'ISO-8859-1' instead of "utf-8" for decoding
text = open(fn, 'rb').read().decode('ISO-8859-1')
Posted by: Guest on September-23-2020

utf-8 codec can't decode byte python

# try this if you get the error utf-8 codec can't decode byte
# Assuming your file is pipe delimited otherwise remove sep='|'
pd.read_csv(r'C:\path\to\file.csv', sep='|', encoding = "ISO-8859-1")
Posted by: Guest on August-12-2021

encode file to utf-8 in java

String charset = "ISO-8859-1"; // or what corresponds
  BufferedReader in = new BufferedReader( 
      new InputStreamReader (new FileInputStream(file), charset));
  String line;
  while( (line = in.readLine()) != null) { 
Posted by: Guest on June-26-2020

Code answers related to "utf-8 codec can't decode byte"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language