今天编译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.
|