Home > Operation and Maintenance > Linux Operation and Maintenance > How to solve garbled output in Linux

How to solve garbled output in Linux

Release: 2019-12-31 13:31:31
Original
3420 people have browsed it

How to solve garbled output in Linux

Linux Chinese garbled characters may be caused by the Chinese language package not being installed.

1. Check whether the Chinese language pack is installed

#locale -a |grep "zh_CN"

If there is no output, it is not installed. You can install it first, use the following command You can install it:

# yum -y groupinstall chinese-support
Copy after login

Modify the configuration file

## 临时生效 
# export LANG="zh_CN.UTF-8"    # 设置为中文 
# export LANG="en_US.UTF-8"    # 设置为英文,我比较喜欢这样 export
Copy after login
## 永久生效, 编辑/etc/sysconfig/i18n(最好reboot一下) 
LANG="zh_CN.UTF-8"
Copy after login

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

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

Reload

# . /etc/profile
Copy after login

Related article tutorial sharing: linux tutorial

The above is the detailed content of How to solve garbled output in Linux. 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