Home > Operation and Maintenance > Linux Operation and Maintenance > Linux terminal displays Chinese garbled characters

Linux terminal displays Chinese garbled characters

王林
Release: 2020-01-11 10:19:53
Original
5006 people have browsed it

Linux terminal displays Chinese garbled characters

1. Install the Chinese language pack

The command is as follows:

# yum -y groupinstall chinese-support
Copy after login

2. Edit the configuration file and set the corresponding character set

Temporarily effective:

# export LANG="zh_CN.UTF-8"    # 设置为中文 
# export LANG="en_US.UTF-8"    # 设置为英文,我比较喜欢这样 export
Copy after login

(Free online video tutorial sharing: linux video tutorial)

Permanent effective:

## 永久生效, 编辑/etc/sysconfig/i18n(最好reboot一下) 
LANG="zh_CN.UTF-8"
Copy after login

Or, edit the /etc/profile configuration file and add the following code:

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

3. Reload

# . /etc/profile
Copy after login

4. View the current character set

# echo $LANG
Copy after login

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of Linux terminal displays Chinese garbled characters. 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