Skip to content

Instantly share code, notes, and snippets.

@SwagDevOps
Created February 17, 2019 16:58
Show Gist options
  • Save SwagDevOps/068a7df97942bbae6db35c2f7fb7a953 to your computer and use it in GitHub Desktop.
Save SwagDevOps/068a7df97942bbae6db35c2f7fb7a953 to your computer and use it in GitHub Desktop.
How to set the default encoding to UTF-8 in Python?
import sys, os
reload(sys)
sys.setdefaultencoding("UTF-8")
# @see http://pythonic.zoomquiet.top/data/20130407004931/index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment