-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sean Moss-Pultz wrote:
> OK. Then I'm going to need to escape this string since the insert is
> really coming from a import of a huge datadump generated in Python.

You should probably explain the big picture first.  Python has at least two
wrappers around SQLite (disclaimer: I am the author of one of them).

>   str.encode("string-escape")
> 
> would be the best method right? Is that aways safe for any string?

SQLite works solely in unicode for strings.  If you are generating text to
feed into the SQLite shell then you also need to follow the rules for SQL
string quoting which are not the same as C/Python/Shell. (eg single quotes
not double, no escape sequences).

> My
> data set is quite large with all kinds of mixtures of strings. I'm
> encoding everything to UTF-8 first. Then writing out a sql dump file
> to import.

Why not just talk directly to SQLite?

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkq/pUgACgkQmOOfHg372QSPzQCdGc2woGg1cAnLOXX8uQXQcP5y
EUwAnjWManvuLxwtAQTSTfMfZas4wZiG
=fs3t
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to