Skip to content

Instantly share code, notes, and snippets.

@simark
Created March 18, 2014 15:50
Show Gist options
  • Save simark/9622857 to your computer and use it in GitHub Desktop.
Save simark/9622857 to your computer and use it in GitHub Desktop.
Convertir descriptions de liste en utf-8
def iso_to_utf(m):
m.Lock()
try:
m.description.decode('utf-8')
except UnicodeDecodeError as e:
# La description n'est pas en utf-8, on la transforme.
m.description = m.description.decode('iso-8859-1').encode()
m.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment