今天編譯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.
|