Skip to content

Commit 9d309c2

Browse files
committed
feature #5100 Change MySQL UTF-8 examples to use utf8mb4 (DHager, Darien Hager)
This PR was submitted for the 2.6 branch but it was merged into the 2.3 branch instead (closes #5100). Discussion ---------- Change MySQL UTF-8 examples to use utf8mb4 You might think MySQL's `utf8` is the right choice, but it's actually got some problems handling certain character inputs. The later, corrected mode of `utf8mb4` has fewer surprises. Commits ------- 7d7d94e Rewrite utf8mb4 cautions, add comment into sample configuration 55874c4 Add backticks for code-styling e3c2fb6 Indenting caution block to nest it inside the sidebar 6406f22 Revert "Fix example name to avoid breaking collision with standard data-collectors" dfc5620 Revert "Add a cautionary note telling users where the "standard" data-collector names can be found." 216ae51 Add a cautionary note telling users where the "standard" data-collector names can be found. f0ced91 Fix example name to avoid breaking collision with standard data-collectors f9cae6c Change MySQL UTF-8 examples to use utf8mb4, which is closer to the standard most people would expect
2 parents bcd62ae + 7d7d94e commit 9d309c2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

book/doctrine.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,13 @@ for you:
141141
.. code-block:: ini
142142
143143
[mysqld]
144-
collation-server = utf8_general_ci
145-
character-set-server = utf8
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`` character 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`_.
146151

147152
.. note::
148153

@@ -1422,3 +1427,4 @@ For more information about Doctrine, see the *Doctrine* section of the
14221427
.. _`migrations`: http://symfony.com/doc/current/bundles/DoctrineMigrationsBundle/index.html
14231428
.. _`DoctrineFixturesBundle`: http://symfony.com/doc/current/bundles/DoctrineFixturesBundle/index.html
14241429
.. _`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

Comments
 (0)