#18392: Use utf8mb4 encoding with MySQL 5.5
-------------------------------------+-------------------------------------
     Reporter:  EmilStenstrom        |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  Database layer       |                  Version:  1.4
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Design
     Keywords:                       |  decision needed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by kmtracey):

 I don't believe setting the connection charset to this new utf8mb4
 encoding (if we're talking to a server that supports it) would cause any
 problem with the indexing: that's a problem that comes into play when you
 change the database charset itself. Whether we need to change that isn't
 clear to me. It's possible that these new characters (stored in a DB with
 utf8mb4 encoding) would be transmitted over a connection that has charset
 set simply to utf8. If so then there's really no point in making any
 connection charset change. So one open question here is: do you get an
 error or incorrect behavior trying to read/write these characters over a
 utf8 connection created by Django when operating on a database with
 utf8mb4 encoding?

 Traditionally Django has not gone beyond advising in the documentation
 what charset to use (uft8) for the database. Django doesn't attempt to set
 the charset for stuff it creates to utf8, it just uses the default charset
 for the DB, which is set before Django ever gets involved. Given this new
 MySQL 5.5 support for "more better" unicode we probably need to update the
 docs to mention the new option for database charset.

 Having the index creation fail for a too-long !CharField is a nuisance. I
 know we've had tickets before that dealt with this issue, but I don't
 recall offhand what the status is. Django tries to disallow creation of a
 !CharField where the index creation will fail, but MySQL makes it
 incredibly difficult to figure out what the right value for "max allowed"
 is. This new encoding just makes for more of a mess there.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18392#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to