Skip to content

Instantly share code, notes, and snippets.

@ento
Created August 30, 2012 08:16
Show Gist options
  • Select an option

  • Save ento/3524077 to your computer and use it in GitHub Desktop.

Select an option

Save ento/3524077 to your computer and use it in GitHub Desktop.
Make python understand 'utf8mb4' as an alias for 'utf8'
# 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