一、安裝中文語言包
執行 sudo dpkg-reconfigure locales 使用空格鍵選中en_US.UTF-8、zh_CN.UTF-8,按tab切換到OK,接着默認選中en_US.UTF-8
二、重啟wsl
以管理員方式打開cmd,依次執行下面的命令
net stop LxssManager
net start LxssManager
三、編輯~/.bash_profile,添加如下內容
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
最后,執行source ~/.bash_profile,此時terminal上輸出的中文不再出現亂碼。
