On 9/11/06, Oleg Broytmann <[EMAIL PROTECTED]> wrote:
> PS. BTW, you seems to know MySQLdb (MySQL-python) good.

Don't let yourself be fooled ;) I only stumbled across some things
while I made my app working with MySQL.

> Can you say how I can prevent MySQLdb from using unicode on input 
> (INSERT/UPDATE)

With MySQL-python.exe-1.2.1_p2.win32-py2.4.exe and earlier it was not
possible to use unicode as the SQL expression.  It was only allowed as
the parameters.  Now, starting from
MySQL-python.exe-1.2.2b1.win32-py2.4.exe it was explicitly changed, so
that unicode is also allowed in the SQL.  So, I think this is not the
answer you looked for, but IMO it is good to be able to give unicode
to the connector and let him encode it in the charset specified in the
connection.

> and output (SELECT)?

I think by specifying use_unicode=1 in the connection one can require
that all results are returned as unicode.

> Or at least how can I know the encoding it uses to convert strings to unicode?

I believe the charset specified in the connection is used for this.

> I have to know the encoding. Is it the same as connection.kw["charset"]? 
> sqlobject_encoding?

I wonder if it is really necessary to specify an additional
sqlobject_encoding anyway.  Shouldn't it be the same as charset?
(Beside the fact, that MySQL uses e.g. 'utf8' as the charset name
instead of 'utf-8', which would probably be the correct name.)

Kind regards,
Markus

-------------------------------------------------------------------------
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

Reply via email to