Re: [pysqlite] Avoid conversion to unicode for APSW
Roger Binns <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Nemanja Čorlija wrote:
> Is something like that available for APSW as well?
APSW does let you massage the row that would be returned using the row
tracer. Unfortunately this is too late since it is passed the row as
obtained from SQLite in the first place.
Note that the database you have created is invalid since SQLite says the
strings are UTF-8. It is a bug in SQLite that it didn't ensure that in
the first place.
You can solve your problem using one of the functions available in
SQLite. For example:
select hex(col) from table
You can then convert that to bytes:
def hex2str(val):
return "".join([ chr (int(val[i:i+2],16))
for i in range(0,len(val),2) ])
Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFIBR39mOOfHg372QQRAuE6AJwJyS2Q9E2JNhXiAQNWjWENGlronQCgiT/O
FTNj2fqAPic5HletXst8C90=
=4rJY
-----END PGP SIGNATURE-----
_______________________________________________
list-pysqlite mailing list
[email protected]
http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite