Current implementation of the mysqlconnection.py accepts
'sqlobject_encoding' and 'charset' parameters but doesn't quite properly
use them.
In particular, MySQLdb does query.encode(charset) call in execute() where
charset is taken from conn.get_character_name(). The problem is - SQLObject
never initializes it properly.
This one-line patch fixes it by adding a call to conn.set_character_set()
in makeConnection() helper.
Index: sqlobject/mysql/mysqlconnection.py
===================================================================
--- sqlobject/mysql/mysqlconnection.py (revision 2269)
+++ sqlobject/mysql/mysqlconnection.py (working copy)
@@ -62,6 +62,8 @@
if hasattr(conn, 'autocommit'):
conn.autocommit(bool(self.autoCommit))
+ conn.set_character_set(self.encoding)
+
return conn
def _setAutoCommit(self, conn, auto):
Oleg Broytman
None
None
Public
|
Date: 2008-03-03 14:48
|
|
Date: 2007-04-25 14:57
|
|
Date: 2007-02-07 14:54
|
|
Date: 2007-02-07 14:46
|
|
Date: 2007-02-07 14:44
|
|
Date: 2007-02-07 14:42
|
|
Date: 2007-02-07 08:34
|
| Filename | Description | Download |
|---|---|---|
| mysql_charset.patch | new version of the patch | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| close_date | - | 2008-03-03 14:48 | phd |
| status_id | Open | 2008-03-03 14:48 | phd |
| resolution_id | None | 2007-04-25 14:57 | phd |
| File Deleted | 214845: | 2007-02-07 15:08 | phd |
| File Added | 214888: mysql_charset.patch | 2007-02-07 14:42 | mfi |
| assigned_to | nobody | 2007-02-07 08:34 | phd |
| File Added | 214845: mysql_charset.patch | 2007-02-07 07:57 | mfi |