当用sublime text 2 编译 python 文件时,若 print 打印出的中文时,控制台会报错:
[Decode error - output not utf-8]
打开 sublime text 2 首选项 -> 浏览插件,进入 Python 文件夹,并找到 Python.sublime-build 文件。
打开如下:
{ "cmd": ["python", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python" }
{ "cmd": ["python", "-u", "$file"], "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "encoding": "cp936" }
sublime text 2编译Python时打印中文报错的解决方案
原文地址:http://blog.csdn.net/jueblog/article/details/44078355