Last active
January 1, 2016 20:59
-
-
Save tlevine/8200901 to your computer and use it in GitHub Desktop.
Decoding hex strings in python
This file contains 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
In [76]: content_disposition = 'attachment;filename="Liste des pr\xe9noms 2004-2012.ods"' | |
In [77]: print(content_disposition) | |
attachment;filename="Liste des proms 2004-2012.ods" | |
In [78]: print eval("u'''%s'''" % content_disposition) | |
attachment;filename="Liste des prénoms 2004-2012.ods" | |
In [79]: u'How do I do this without eval?' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment