Answers for "python cant decode utf-16 file"

7

python open encoding utf-8

from io import open
f = open("test", mode="r", encoding="utf-8")
Posted by: Guest on November-17-2020
0

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:pathtofile.csv', sep='|', encoding = "ISO-8859-1")
Posted by: Guest on August-12-2021

Python Answers by Framework

Browse Popular Code Answers by Language