尝试在Excel中将点更改为逗号时出现UnicodeDecodeError

时间:2016-12-01 20:33:08

标签: python excel encoding utf-8

我目前正在尝试运行以下代码:

import csv

with open("C:\\Users\\User\\Downloads\\stu21617.rw2.xlsx", 'r', encoding='utf-8') as infile: 
    with open("C:\\Users\\User\\Documents\\jens\\komma.xlsx", 'w', encoding='utf-8') as outfile:
        tabel = []
        writer = csv.writer(outfile, delimiter = ';')
        for rij in csv.reader(infile, delimiter = ';'):
            writer.writerow(rij.replace('.', ','))

但是我收到以下错误:

UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 15-16: invalid continuation byte

0 个答案:

没有答案