[PyQt] Storing QString/Unicode in Sqlite Database

Tayfun Kayhan tayfun92_kayhan at yahoo.com
Tue Nov 8 22:20:40 GMT 2011


Hi all, I wanna get texts from some QLineEdits' and QComboBoxes and store them in Sqlite DB. But I keep gettin the following error, i also tried using following commands that did not worked : 

self.info = some_lineEdit.text()
self.info = str(u"%s" % some_lineEdit.text()) 
self.info = some_lineEdit.text().toUtf8() 
self.info = _fromUtf8(some_lineEdit.text()) 


sqlite3.ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.


Everything works fine when i don't enter unicode strings,  so problem is exactly the unicode. Any help is appreciated. Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111108/fdf48156/attachment-0001.html>


More information about the PyQt mailing list