Home > Article > Operation and Maintenance > How to modify the character set in linux
Method: 1. Use the "LANG=Character Set" or "export LANG=Character Set" command to temporarily modify the character set; 2. Use the "vi /etc/sysconfig/i18n" command to permanently modify the character set configuration file Modify character set.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
1.1. locale
1.2, echo $LANG
1.3, env |grep LANG
[root@localhost ~]# locale -a
##3. Modify the system character set3.1 , Temporarily effectiveFor example, if the character set is modified to: zh_CN.gb2312
, you can see that the system character set is modified from the original en_US.UTF-8 to zh_CN.gb2312, but restart the system or reopen a shell.
The character set is still the original character set, that is: en_US.UTF-8
##3.2, permanent effectFor example, the character set is modified to: zh_CN .gb2312, restart the system and reopen the shell, it will not fail
cat /etc/sysconfig/i18n
View the character set configuration file vi /etc/sysconfig/i18nen_US.UTF-8 is modified to zh_CN.gb2312
source /etc/sysconfig/i18n It takes effect immediately, and then check the characters Set, has become the modified
Linux Video Tutorial###"######The above is the detailed content of How to modify the character set in linux. For more information, please follow other related articles on the PHP Chinese website!