@@ -134,21 +134,20 @@ for you:
134
134
There's no way to configure these defaults inside Doctrine, as it tries to be
135
135
as agnostic as possible in terms of environment configuration. One way to solve
136
136
this problem is to configure server-level defaults.
137
-
138
- .. caution ::
139
-
140
- If you are using MySQL, its ``utf8 `` character set actually only supports
141
- a portion of valid UTF-8 data that you may encounter. Instead, try to
142
- use the newer ``utf8mb4 `` if your system supports it.
143
137
144
138
Setting UTF8 defaults for MySQL is as simple as adding a few lines to
145
139
your configuration file (typically ``my.cnf ``):
146
140
147
141
.. code-block :: ini
148
142
149
143
[mysqld]
150
- collation-server = utf8mb4_general_ci
151
- character-set-server = utf8mb4
144
+ # Version 5.5.3 introduced "utf8mb4", which is recommended
145
+ collation-server = utf8mb4_general_ci # Replaces utf8_general_ci
146
+ character-set-server = utf8mb4 # Replaces utf8
147
+
148
+ We recommend against MySQL's ``utf8 `` characte
6E72
r set, since it does not
149
+ support 4-byte unicode characters, and strings containing them will be
150
+ truncated. This is fixed by the `newer utf8mb4 character set `_.
152
151
153
152
.. note ::
154
153
@@ -1428,3 +1427,4 @@ For more information about Doctrine, see the *Doctrine* section of the
1428
1427
.. _`migrations` : http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
1429
1428
.. _`DoctrineFixturesBundle` : http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
1430
1429
.. _`FrameworkExtraBundle documentation` : http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
1430
+ .. _`newer utf8mb4 character set` : https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html
0 commit comments