# HG changeset patch # User Mads Kiilerich # Date 2016-01-05 16:30:11 # Node ID 6353b5e870917c09cfd07fe569d428a92a12d0d7 # Parent 82ed7ad0dc480a8e8fc102edb008bdad68862be0 ini: specify utf8 for sample MySQL connection strings By default, the MySQL stack will store unicode as UTF-8 encoded data in string fields, thus without using any unicode capabilities in the database. As described in http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#mysql-unicode , set charset=utf8 to actually put unicode in the database. Existing databases that already store utf8 in the database should keep using the old url. This will only support 16 bit code points, but utf8mb4 will double the key size and make them too big for MySQL. diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -493,7 +493,7 @@ sqlalchemy.db1.url = sqlite:///%(here)s/ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others diff --git a/kallithea/bin/template.ini.mako b/kallithea/bin/template.ini.mako --- a/kallithea/bin/template.ini.mako +++ b/kallithea/bin/template.ini.mako @@ -495,7 +495,7 @@ sqlalchemy.db1.url = postgresql://user:p %elif database_engine == 'mysql': # MySQL -sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 %endif # see sqlalchemy docs for others diff --git a/kallithea/config/deployment.ini_tmpl b/kallithea/config/deployment.ini_tmpl --- a/kallithea/config/deployment.ini_tmpl +++ b/kallithea/config/deployment.ini_tmpl @@ -485,7 +485,7 @@ sqlalchemy.db1.url = sqlite:///%(here)s/ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others diff --git a/kallithea/tests/test.ini b/kallithea/tests/test.ini --- a/kallithea/tests/test.ini +++ b/kallithea/tests/test.ini @@ -495,7 +495,7 @@ sqlalchemy.db1.url = sqlite:///%(here)s/ #sqlalchemy.db1.url = postgresql://user:pass@localhost/kallithea # MySQL -#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea +#sqlalchemy.db1.url = mysql://user:pass@localhost/kallithea?charset=utf8 # see sqlalchemy docs for others