is there a library/program that converts sqlite database from windows-1252 to utf-8 ?

Stef Mientki stef.mientki at gmail.com
Sat Sep 11 17:45:15 EDT 2010


 On 11-09-2010 21:11, Robert Kern wrote:
> SQLite internally stores its strings as UTF-8 or UTF-16 encoded Unicode. So it's not clear what
> you mean when you say the database is "windows-1252". Can you be more specific?
I doubt that, but I'm not sure ...
For some databases written by other programs and
written with Python, with
    cursor = self.conn.cursor ()
    self.conn.text_factory = str

Can only be read back with with text_factory = str
then the resulting string columns contains normal strings with windows 1252 coding, like character 0xC3

Reading these databases with text_factory = unicode,
results in exceptions, when such a string with 0xC3 is encountered.

As I want to switch completely to unicode,
to prevent these kind of problems in the future.

cheers,
Stef




More information about the Python-list mailing list