View and modify Linux character set

· View a character set 
character set is embodied in the form of a system environment variables to CentOS6.5 example, the View the current terminal character set can use the following ways:

The first:

[root@Testa-www tmp]# echo $LANG
zh_CN.UTF-8

The second:

[root @ Testa-www ~] # env | grep LANG 
LANG = zh_CN.UTF-8

Third:

[root@Testa-www ~]# export |grep LANG
declare -x LANG="zh_CN.UTF-8"

Fourth:

Copy the code
[root@Testa-www ~]# locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
Copy the code

Second, modify the character set way 
must be noted that: If the default language is en_US.UTF-8, are unable to display and input Chinese characters and in the Linux graphical interface. If the default language is Chinese, such as zh_CN.GB18030 or zh_CN.gb2312, not character display and input interface, graphical interface. 

There are two ways to modify:

1, disposed directly modify the variable

export LANG=zh_CN.UTF-8

2, papers modified by modifying the / etc / sysconfig / i18n file control

[root@Testa-www ~]# vim /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
[root@Testa-www ~]# source /etc/sysconfig/i18n 

Guess you like

Origin www.cnblogs.com/xibuhaohao/p/12001472.html