Skip to content

Instantly share code, notes, and snippets.

@raghothams
Created January 21, 2014 18:40
Show Gist options
  • Save raghothams/8545659 to your computer and use it in GitHub Desktop.
Save raghothams/8545659 to your computer and use it in GitHub Desktop.
Python Unicode conversion error
# Solving unicode to ascii conversion error
str1 = '\xc6\xe5\t\xc5\xba\xc6;\xe4y\xdf8\xd8U\xcb\xff\xaaT@\r&\x8c\xbd\x95v'
print type(str1)
str_in_ascii = str1.encode('base-64')
print type(str_in_ascii)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment