Sublime Text: [Decode error - output not utf-8]

今天编译Python时, 输出窗口信息出现:

[Decode error - output not utf-8]
[Decode error - output not utf-8]
 
发现是print不支持中文字符的输出, 需要修改python的build的setting, 打开Python.sublime-build,
修改为:
 
{
     "cmd": ["C:/Python33/python.exe", "-u", "$file"],
     "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
     "selector": "source.python"
     "encoding": "cp936"
}
 
修改后用REPL可以正常输出, 但是Ctrl + B编译有问题, 空白没反映,可以按ctrl+‘来显示错误。
 
后来只能通过另外一种方法解决Unicode问题,
在系统变量加入PYTHONIOENCODING,值填写utf-8
win7在桌面,计算机右键选属性,选高级系统设置,选高级标签,选环境变量

重启sublime text2.
posted @ 2015-10-21 22:05  狂师  阅读(342)  评论(0编辑  收藏  举报