On Mon, Feb 25, 2008 at 3:33 PM, iain duncan <[EMAIL PROTECTED]> wrote:
> > > > The MySQL database URLs require charset=utf8 as well: > > > > > sqlalchemy.dburi="mysql://web:password/momcafe_dev?charset=utf8" > > > > The driver doesn't seem to detect the connection character set well and > > needs a hint. From the traceback, it looks like the driver thinks the > > connection should be ascii. > > Adding the charset argument gives me the following error on start up: > > File > "/usr/lib/python2.4/site-packages/SQLAlchemy-0.4.2p3-py2.4.egg/sqlalchemy/engine/strategies.py", > line 80, in connect > raise exceptions.DBAPIError.instance(None, None, e) > sqlalchemy.exceptions.DBAPIError: (TypeError) 'charset' is an invalid > keyword argument for this function None None > > Is there another way to set that up somewhere? > > Thanks > Iain > From: http://www.sqlalchemy.org/docs/04/sqlalchemy_databases_mysql.html "Many MySQL server installations default to a latin1 encoding for client connections. All data sent through the connection will be converted into latin1, even if you have utf8 or another character set on your tables and columns. With versions 4.1 and higher, you can change the connection character set either through server configuration or by passing the charsetparameter to create_engine. The charset option is passed through to MySQL-Python and has the side-effect of also enabling use_unicode in the driver by default. For regular encoded strings, also pass use_unicode=0 in the connection arguments." You might also try the "encoding" option...not clear from SQLAlchemy docs which is preferred and what the difference is (if any). What version of MySQL/MySQLdb are you using? Kevin Horn --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

