macOS 下 iTerm 2 加 Oh-My-Zsh 下遠程執行python輸出中文報錯

問題
ssh 到服務器 python xxx.py 時出現

UnicodeEncodeError: 'ascii' codec can't encode character in position 0: ordinal not in range(128)

解決方案
在 .zshrc 末尾添加:

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章