Reputation: 13
i try to open a file in utf-8 and step trough the file with the csv.reader:
with codecs.open(sap_file, "rb", "utf-8") as in_file:
#self.logger.debug("open")
self.reader = csv.reader(in_file,delimiter=";")
for row in self.reader:
self.pnrs[(row[1])]={}
for rows in self.reader:
self.pnrs[rows[1]][rows[3]]=rows[4]
But here is my traceback:
for row in self.reader:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 38: ordinal not in range(128)
Somebody here with some tips?
Upvotes: 1
Views: 114