Solve the problem of Chinese garbled characters in ubuntu

Ubuntu Chinese support, and Chinese garbled problem

This blog post is the result of the pit I stepped on for an afternoon, and it is effective for personal testing. The same applies to the server.

Status: The ubuntu system used does not support Chinese. ORZ…

Goal: Make the system/server support Chinese and display it normally.

First, install the Chinese support package language-pack-zh-hans:

$ sudo apt-get install language-pack-zh-hans

Then, modify /etc/environment (append at the end of the file):

LANG="zh_CN.UTF-8"
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):

en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
zh_CN GB2312

Finally, execute the command:

$ sudo locale-gen

For the case where Chinese garbled characters are spaces, install Chinese fonts to solve the problem.

$ sudo apt-get install fonts-droid-fallback ttf-wqy-zenhei ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming

Above, the problem is solved, and the Chinese display is normal. :)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325780855&siteId=291194637