Home  >  Article  >  Operation and Maintenance  >  Solution to Chinese garbled characters in centos system

Solution to Chinese garbled characters in centos system

尚
Original
2020-03-23 16:20:274226browse

Solution to Chinese garbled characters in centos system

centos system Chinese garbled solution:

Recommended tutorial: centos usage tutorial

1. Check if your system has To install the Chinese language pack, you can use the locale -a command to list all available language environments and see if there are the following four items:

Solution to Chinese garbled characters in centos system

If so, there is no need to install it. If No, you need to reinstall it. Use the yum install kde-l10n-Chinese command to directly install the Chinese language pack.

2. Modify the configuration files of i18n and locale.conf

Use the vim/etc/sysconfig/i18n command to open the i18n file

Add the following two lines of code inside:

LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"

Then execute the source/etc/sysconfig/i18n command to make the configuration take effect.

Use the vim /etc/locale.conf command to open the locale.conf file, add the envy code:

LANG="zh_CN.UTF-8"

Then execute the source /etc/locale.conf command to make the configuration take effect.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of Solution to Chinese garbled characters in centos system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn