What to do if the Chinese characters in centos7 terminal are garbled

藏色散人
Release: 2022-01-17 11:08:01
Original
22257 people have browsed it

The solution to Chinese garbled characters in centos7 terminal: 1. Check the server encoding; 2. Check the terminal xshell encoding; 3. Set "export LANG="zh_CN.UTF-8""; 4. Restart the server.

What to do if the Chinese characters in centos7 terminal are garbled

#The operating environment of this article: centos7 system, Dell G3 computer.

What should I do if the Chinese characters in the centos7 terminal are garbled?

centos7 terminal displays garbled Chinese characters, and the command returns Chinese garbled characters

1. Check the server encoding command

1.1

echo $LANG
Copy after login

1.2

locale
Copy after login

1.3 Check the terminal xshell encoding

If the above The three points are still consistent, but the code is still garbled. See 2

2. Edit the file

2.1

vi /etc/sysconfig/i18n
Copy after login

Paste the following text

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

2.2

vi /etc/profile
Copy after login

Paste the following text

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

3. Finally restart the server

Check and you can see that the Chinese file name is displayed normally

Commands and naming returns are also in Chinese!

The same text content is also in Chinese

Recommended tutorial: "centos tutorial"

The above is the detailed content of What to do if the Chinese characters in centos7 terminal are garbled. 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