Ok, good to know.  I figured out a solution, temporary and possibly
patchable.  First the temporary:

mydb = web.database(dbn='mysql', db='foo', user='me', charset='utf8')

So, just pass a charset keyword arg.  It looks like in the Postgres
class, we set it to 'UTF8' by default, so here's a patch that would
default MySQL to utf8:

diff --git a/web/db.py b/web/db.py
index ae5551c..f08fc3a 100644
--- a/web/db.py
+++ b/web/db.py
@@ -878,6 +878,8 @@ class MySQLDB(DB):
         if 'pw' in keywords:
             keywords['passwd'] = keywords['pw']
             del keywords['pw']
+        if not 'charset' in keywords:
+            keywords['charset'] = 'utf8'
         self.paramstyle = db.paramstyle = 'pyformat' # it's both,
like psycopg
         self.dbname = "mysql"
         self.supports_multiple_insert = True



On Nov 26, 10:58 pm, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> > Am I doing something wrong?  Is this a problem with the MySQL bindings
> > for python?
>
> This is a bug -- someone should figure out how to get the MySQL
> bindings to return Unicode and write a patch.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to