O
O
OctorberMyMonth2021-03-25 14:57:17
Python
OctorberMyMonth, 2021-03-25 14:57:17

How to deal with nicodeDecodeError: 'utf-8' codec can't decode byte?

def read_csv():

    with open('data.csv', encoding='utf-8') as file:
        file = csv.reader(file)
        for row in file:
            print(row[0])


Throws an error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0.
OS: Windows. If you set the encoding to 'latin-1', then it reads without errors, but it's not fucking clear)
The file that reads: " opendata.fssprus.ru/7709576929-iplegallist/data-20... "

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
buttman, 2021-03-25
@buttman

If I'm not mistaken, you need to change the system language to English

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question