UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 0:

Get this error: "UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd0 in position 0: invalid continuation byte: when trying to compare 2 excels files.

${csvA} = Get File ${SOURCE_DIR}${/}elec1.csv
${csvB} = Get File ${SOURCE_DIR}${/}elec2.csv
Should Be Equal As Strings ${csvA} ${csvB}

any leads will be appreciated .

Thank you.

These CSV files are not UTF-8 encoded!
Check the encoding.

If they are generated with Excel, they maybe ISO-8859-x or cp1252…

Open each file in a good editor and save them as UTF-8 (no BOM).

As already pointed out above, these files aren’t in UTF-8. The reason that’s a problem is that UTF-8 is the default encoding Get File uses. It supports also other encodings, so assuming you know the actual encoding these files use you can specify it explicitly. Check the keyword documentation for details.

1 Like