Skip to content

Instantly share code, notes, and snippets.

@takinbo
Created April 18, 2009 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takinbo/97530 to your computer and use it in GitHub Desktop.
Save takinbo/97530 to your computer and use it in GitHub Desktop.
# in case you ever come across a similar error in python:
#
# UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in
# position 2: ordinal not in range(128)
#
# simply use these
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment