1 python文件代码中中文的识别 (换言之,python代码的中文不显示乱码)和解析u"中文"这样的unicode对象 # coding=utf8

2 python运行环境(IDE)系统的编码:

  import sys

  reload(sys)

  sys.setdefaultencoding('utf-8')

  这个是设置string的默认编码格式

  即string.encode('utf-8')

相关文章: