Created
August 30, 2012 08:16
-
-
Save ento/3524077 to your computer and use it in GitHub Desktop.
Make python understand 'utf8mb4' as an alias for 'utf8'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # oursql in particular doesn't recognize utf8mb4 as a valid charset | |
| # source: https://code.djangoproject.com/ticket/18392#comment:10 | |
| import codecs | |
| codecs.register(lambda name: codecs.lookup('utf8') if name == 'utf8mb4' else None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment