G
Gilles Ganault
Hello
It seems like I have Unicode data in a CSV file but Python is using
a different code page, so isn't happy when I'm trying to read and put
this data into an SQLite database with APSW:
========
sql = "INSERT INTO mytable (col1,col2) VALUES (?,?)"
cursor.executemany(sql, records("test.tsv"))
"""
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position
18: ordinal not in range(128)
"""
========
What should I do so Python doesn't raise this error? Should I convert
data in the CVS file, or is there some function that I should call
before APSW's executemany()?
Thank you.
It seems like I have Unicode data in a CSV file but Python is using
a different code page, so isn't happy when I'm trying to read and put
this data into an SQLite database with APSW:
========
sql = "INSERT INTO mytable (col1,col2) VALUES (?,?)"
cursor.executemany(sql, records("test.tsv"))
"""
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position
18: ordinal not in range(128)
"""
========
What should I do so Python doesn't raise this error? Should I convert
data in the CVS file, or is there some function that I should call
before APSW's executemany()?
Thank you.