問題隨記 —— 【Linux】Ubuntu設置中文語言環境(WSL可用)

問題現象:終端、edgevscode等軟件出現亂碼

問題隨記 —— 【Linux】Ubuntu設置中文語言環境(WSL可用)

解決方法

① 安裝中文語言包

sudo apt-get install language-pack-zh-han*

② 運行語言支持檢查

sudo apt install $(check-language-support)

③ 修改相關配置文件

編輯 /etc/default/locale 文件:

sudo vim /etc/default/locale

將內容替換為以下:

LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh" LC_NUMERIC="zh_CN" LC_TIME="zh_CN" LC_MONETARY="zh_CN" LC_PAPER="zh_CN" LC_NAME="zh_CN" LC_ADDRESS="zh_CN" LC_TELEPHONE="zh_CN" LC_MEASUREMENT="zh_CN" LC_IDENTIFICATION="zh_CN" LC_ALL="zh_CN.UTF-8"

④ 修改環境變量

編輯 /etc/profile 文件:

sudo vim /etc/profile

在文件的最后一行添加以下內容:

LANG="zh_CN.UTF-8"

? 版權聲明
THE END
喜歡就支持一下吧
點贊5 分享