Skip to content

Instantly share code, notes, and snippets.

@canabady
Last active February 6, 2017 05:59
Show Gist options
  • Save canabady/8edcbf0b4a19fd6905ca59a15af245c0 to your computer and use it in GitHub Desktop.
Save canabady/8edcbf0b4a19fd6905ca59a15af245c0 to your computer and use it in GitHub Desktop.
How to fix: UnicodeDecodeError: 'ascii' codec can't decode byte
# How to fix: “UnicodeDecodeError: 'ascii' codec can't decode byte”
# -----------------------------------------------------------------
# Add the below code in the heading of python file
import sys
reload(sys)
sys.setdefaultencoding('utf8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment