On Mon, Sep 11, 2006 at 09:53:25PM +0200, Markus Gritsch wrote:
> Everything works fine when using an SQLite connection
A bug in SQLite, PySQLite or SQLiteConnection? Postgres (or psycopg)
does not allow unicode.
> if self.need_unicode:
> into
> if self.need_unicode and not isinstance(query, unicode):
> in mysqlconnection.py make things worse?
Yes, because it hides the real source of the problem. This make much
harder to port your programs to other non-unicode supporting backends.
The real problem is in SQLObject internals. A query now must be a
string. And rewriting the core to always use unicode would be a hard job -
a big task by itself, and raises questions about BLOBCol, PickleCol...
PS. BTW, you seems to know MySQLdb (MySQL-python) good. Can you say how I
can prevent MySQLdb from using unicode on input (INSERT/UPDATE) and output
(SELECT)? Or at least how can I know the encoding it uses to convert
strings to unicode? Unicode output from MySQLdb is a constant source of
pain for PickleCol users. There is the code in PickleValidator:
def to_python(self, value, state):
if isinstance(value, unicode):
value = value.encode("ascii")
"ascii" encoding here is wrong, and unpickler doesn't accept unicode. So
I have to know the encoding. Is it the same as connection.kw["charset"]?
sqlobject_encoding? client_encoding?
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss