Hi<br><br>At first, you should probably use something like <br> unicode(<font size="2">some_lineEdit.text(), 'utf8'), if you want to convert string to unicode.<br>At second, for me all unicode conversion problems disappeared after I started using QString API v2. In this case, PyQt methods always return you unicode instead of QStrings<br>
<a href="http://www.riverbankcomputing.com/static/Docs/PyQt4/html/incompatible_apis.html">http://www.riverbankcomputing.com/static/Docs/PyQt4/html/incompatible_apis.html</a><br><br>Andrei<br></font><br><div class="gmail_quote">
On Wed, Nov 9, 2011 at 1:20 AM, Tayfun Kayhan <span dir="ltr"><<a href="mailto:tayfun92_kayhan@yahoo.com" target="_blank">tayfun92_kayhan@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:tahoma, new york, times, serif;font-size:10pt"><div><font size="2">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 : </font></div>
<div><font size="2"><br></font></div><div><font size="2"><a href="http://self.info" target="_blank">self.info</a> = some_lineEdit.text()</font></div><div><font size="2"><a href="http://self.info" target="_blank">self.info</a> = str(u"%s" % some_lineEdit.text()) </font></div>
<div><font size="2"><a href="http://self.info" target="_blank">self.info</a> = some_lineEdit.text().toUtf8() </font></div><div><font size="2"><a href="http://self.info" target="_blank">self.info</a> = _fromUtf8(some_lineEdit.text()) </font></div>
<div><font size="2"><br></font></div><div><font size="2"><br></font></div><div><font size="2">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.</font></div>
<div><font size="2"><br></font></div><div><font size="2">Everything works fine when i don't enter unicode strings, so problem is exactly the unicode. Any help is appreciated. Thanks.</font></div></div></div><br>_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br></blockquote></div><br>