Home > Operation and Maintenance > CentOS > How to solve Chinese garbled characters in CentOS

How to solve Chinese garbled characters in CentOS

angryTom
Release: 2020-03-18 11:46:43
Original
7335 people have browsed it

How to solve Chinese garbled characters in CentOS

How to solve Chinese garbled characters in CentOS

1. Check whether the Chinese language package is installed on your system. You can use the locale -a command to list all Available language environments:

#locale -a
Copy after login

Check if there are the following four items: (Recommended learning: MySQL Video Tutorial)

zh_CN.gb1830
zh_CN.gb232
zh_CN.gbk
zh_CN.utf8
Copy after login

If there is, there is no need to install it. If there is not, there is no need to install it. , need to reinstall, use

yum install kde-l10n-Chinese
Copy after login

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

First, vim/etc/sysconfig/i18n, add the following two lines of code in it:

LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
Copy after login

Then execute it to make the newly modified file take effect:

source/etc/sysconfig/i18n
Copy after login

Second, vim /etc/locale.conf

添加:LANG="zh_CN.UTF-8"
Copy after login

Execute it similarly to make the newly modified file take effect. The file takes effect

source /etc/locale.conf
Copy after login

This article comes from the PHP Chinese website, CentOS usage tutorial column, please pay attention to this column for more related tutorials!

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template