I am just doing a pull down of a database table and trying to read it into python like so:
with query(full_query_string) as cur:
arr = cur.fetchall()
This produces the following error from the fetchall()
:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 4: invalid continuation byte
If I select *
I get this error whereas if I limit to a small number of rows, I don't get this error. I tried paying around with a few encodings following this SO post UnicodeDecodeError, invalid continuation byte but none of them are doing the trick. In a large db table where I don't know how the encoding could have gone wrong, what's the most efficient way to deal with this? Also, no specific row is a must-have, but I'd rather get all the rows other than whichever ones have this encoding problem.