Deploy arm cross tool chain in actual WSL2.0 docker image (2)
4. Solve the problem that Ubuntu Chinese is displayed as garbled
Author: 1024 Small God
blog: https://blog.csdn.net/weixin_44786530/article/details/93327253
release:
-
Install the Chinese language support package language-pack-zh-hans:
sudo apt install language-pack-zh-hans zh-autoconvert zhcon
-
Modify /etc/environment (append at the end of the file):
LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh:en_US:en"
or
Modify the .profile or .bashrc file in the user directory and add the following content:
LANG="zh_CN.UTF-8" LANGUAGE="zh_CN:zh:en_US:en"
Just log in again. This method is only valid for this user. Enter the following command in the terminal to take effect immediately
export LANG="zh_CN.UTF-8" export LANGUAGE="zh_CN:zh:en_US:en"
-
Then modify /var/lib/locales/supported.d/local (create a new file without this file, and also append it at the end):
zh_CN.GBK GBK zh_CN GB2312 zh_CN.UTF-8 UTF-8 en_US.UTF-8 UTF-8
-
Excuting an order:
sudo locale-gen
-
For Chinese garbled characters with spaces, install Chinese fonts to solve them.
sudo apt install fonts-droid-fallback ttf-wqy-zenhei ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming