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:
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!