I write a list into a csv file using unicodecsv module, encoding it by "utf-8", but when I try to read it using unicodecsv.reader, I still get the error:UnicodeDecodeError: 'utf8' codec can't decode byte...
. I can read it in by csv.reader. Is there something that I am missing?
My codes are like this:
with open(datapath + filename, 'wb') as csvfile:
writer_to_csv = unicodecsv.writer(csvfile, encoding = "utf-8")
writer_to_csv.writerows(data)
When I try to read it:
with open(datapath + filename, 'rb') as csvfile:
file_to_list = unicodecsv.reader(csvfile, encoding = "utf-8")
I got the error message.