Solution to centos6 terminal garbled characters: 1. Set "export LC_ALL=zh_CN.UTF-8"; 2. Edit "/etc/locale.conf" and set "LANG=zh_CN.UTF-8 LC_ALL= zh_CN.UTF-8" is enough.
#The operating environment of this article: centos6 system, Dell G3 computer.
How to solve the centos6 terminal garbled problem?
Centos6.x terminal Chinese garbled solution:
locale
LANG
The default value of LC_* is the lowest level setting. If LC_* is not set, then use this value. Similar to LC_ALL.
LC_ALL
It is a macro. If the value is set, the value will overwrite all LC_* setting values. Note that the value of LANG is not affected by this macro.
It takes effect directly without restarting:
export LC_ALL=zh_CN.UTF-8
It takes effect permanently:
Edit /etc/locale.conf
LANG=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8
#用这个就行了,但是不知道为什么 echo.UTF-8 > /etc/sysconfig/i18n
-- ------------------------The original text below does not seem to work and will cause English display errors--------
Modify/ etc/profile file
vim /etc/profile #添加这行 export LC_ALL="zh_CN.GB18030" #立即生效 source /etc/profile
Recommended tutorial: "centos tutorial"
The above is the detailed content of How to solve the centos6 terminal garbled problem. For more information, please follow other related articles on the PHP Chinese website!