6.5 and I am trying to extract some information from a CSV file, but the file is written in Russian, so I need to use 'cp866' to decode that. However, I can't get the correct output.
This is the code that I use:
def printcsv():
with open('vocabulary.csv',newline='') as f:
reader = csv.reader(f)
for row in reader:
#store in array
print(row.decode('cp866'))
This is the error that I got:
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa7 in position 0: ordinal not in range(128)