当用sublime text 2 编译 python 文件时,若 print 打印出的中文时,控制台会报错:
[Decode error - output not utf⑻]
解决方案以下:
打开 sublime text 2 首选项 -> 阅读插件,进入 Python 文件夹,并找到 Python.sublime-build 文件。
打开以下:
{
cmd: [python,-u,$file],file_regex: ^[ ]*File (...*?),line ([0⑼]*),selector: source.python
}
将其修改成:
{
cmd: [python,selector: source.python,encoding: cp936
}
便可解决该问题。