Created
October 15, 2013 02:18
-
-
Save guori12321/6985576 to your computer and use it in GitHub Desktop.
how to read utf-8 file with 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
import sys | |
reload(sys) | |
sys.setdefaultencoding("utf-8") | |
readFile = open('test.txt', 'r') | |
print readFile.read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment