[Decode error - output not utf-8]
[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"
}
"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. |