From: Thomas Grainger Date: Wed, 18 Mar 2015 11:40:03 +0000 (+0000) Subject: add utf8mb4 recommendation X-Git-Tag: rel_1_0_0b2~6^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6e8ecd161bfb95b39713ba406921fb277b2802a3;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add utf8mb4 recommendation --- diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index 0d125a2451..a65f69622c 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -28,6 +28,18 @@ unicode** will include both charset and use_unicode=0:: create_engine("mysql+mysqldb://user:pass@host/dbname?charset=utf8&use_unicode=0") +For MySQL versions 5.5.3 and MySQLdb version 1.2.3 forward, the special +MySQL-specific encoding 'utf8mb4' is now recommended:: + + create_engine("mysql+mysqldb://user:pass@host/dbname?charset=utf8mb4&use_unicode=0") + +The 'utf8' encoding may still be used, however MySQL will only support +unicode characters within the first three of four possible bytes: +no (💩 or 😻) note that in order to use utf8mb4 fully, changes to +the MySQL schema and/or server configuration may be required. +See also: `The utf8mb4 character set +_`. + As of this writing, MySQLdb only runs on Python 2. It is not known how MySQLdb behaves on Python 3 as far as unicode decoding.