Tuesday 15 February 2011

unicode - UnicodeDecodeError in SQLite -


I am trying to get a list of 2-element tuples and give them a SQLite table .

The first element of a tupal is a string (encoded in Unicode UTF-8 ) and the second element is a murmurhash3 hash utf -8 string

This violation line is: result

  self.dbc.primaryCursor.executemany ("Enter value in table" (?,?); Last_insert_rowid () select as lastowid ; ", ListOfTermsAndHashesTuples)   

Error UnicodeDecodeError : 'ASCI' codec can not decode byte 0xc3 in position 4 : In the serial no category (128).

What is the reason for this error?

Your input is very likely not in the valid UTF-8 format. On Linux and Mac, you can easily see your string by putting it in a file:

  iconv -f UTF-8 -t UTF-8 & lt; Your_filename_goes_here & gt;    

No comments:

Post a Comment