From 710de5342451a78dd4b955371908a91a630d0c37 Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 30 Oct 2010 17:03:24 +0000 Subject: [PATCH] Adding use_unicode=0 to the MySQL database connection string restores the behavior, that unicode strings are returned instead of strings. If use_unicode=1 (default), sqlalchemy requests unicode strings from the MySQLdb backend (and does not do the conversion itself), however, since the tables are defined as 'varchar(x) binary' only binary string are returned and not converted to unicode. git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/wradmin@617 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- wradmin/development.ini | 3 ++- wradmin/wradmin/config/deployment.ini_tmpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wradmin/development.ini b/wradmin/development.ini index ccfe1a5..0239233 100644 --- a/wradmin/development.ini +++ b/wradmin/development.ini @@ -36,7 +36,8 @@ authkit.basic.authenticate.user.data = #beaker.session.data_dir = %(here)s/data/sessions # SQLAlchemy database URL -sqlalchemy.url = mysql://philipp@localhost:3306/winterrodeln_wiki?charset=utf8 +sqlalchemy.url = mysql://philipp@localhost:3306/winterrodeln_wiki?charset=utf8&use_unicode=0 +# If use_unicode=1, sqlalchemy requests unicode strings from the MySQLdb backend (and does not do the conversion itself), however, since the tables are defined as 'varchar(x) binary' only binary string are returned and not converted to unicode. # necessary for mySQL databases sqlalchemy.pool_recycle = 3600 # sqlalchemy.echo_pool = 1 diff --git a/wradmin/wradmin/config/deployment.ini_tmpl b/wradmin/wradmin/config/deployment.ini_tmpl index 095acad..d0fa0d4 100644 --- a/wradmin/wradmin/config/deployment.ini_tmpl +++ b/wradmin/wradmin/config/deployment.ini_tmpl @@ -36,7 +36,7 @@ authkit.basic.authenticate.user.data = #beaker.session.data_dir = %(here)s/data/sessions # SQLAlchemy database URL -sqlalchemy.url = mysql://user@localhost:3306/winterrodeln_wiki?charset=utf8 +sqlalchemy.url = mysql://user@localhost:3306/winterrodeln_wiki?charset=utf8&use_unicode=0 # necessary for mySQL databases sqlalchemy.pool_recycle = 3600 -- 2.39.5