方法一:
import codecs
with codecs.open('somefile.txt', 'r', 'GBK') as f:
data = f.read()
print data
方法二:
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
fin = open('somefile.txt', 'r')
for eachLine in fin:
line = eachLine.strip().decode('gbk', 'utf-8')
print line