Fix the messy code of archlinux to display chinese

ArchWiki
Click the hyperlink above, you can chose a font to download.

Reason

Why this happen.

When we locale our archlinux at the very beginning, we uncomment two line in file /etc/locale.gen and set the LANG variable by adding LANG=en_US.UTF-8 to /etc/locale.conf:

1
2
3
4
sed -i 's/^#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
sed -i 's/^#zh_CN.UTF-8/zh_CN.UTF-8/' /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" >> /etc/locale.conf

That’s not enough.

Solution

One Chinese font needed to be download to display the Chinese in the right way:

1
sudo pacman -S wqy-zenhei

It will be fixxed

Adding Chinese input method and googlepinyin

Install the fcitx:

1
sudo pacman -S fcitx fcitx-googlepinyin fcitx-configtool

Adding some environment variable in ~/.xinitrc and start the fcitx when you enter X:

1
fcitx &

Use fcitx-configtool to set googlepinyin:

1
$ fcitx-configtool

restart the X.


Fix the messy code of archlinux to display chinese
http://example.com/2022/09/05/Fix-the-messy-code-of-archlinux-to-display-chinese/
作者
Jie
发布于
2022年9月5日
许可协议