Home >Operation and Maintenance >Linux Operation and Maintenance >How to modify the character set in linux

How to modify the character set in linux

WBOY
WBOYOriginal
2022-01-27 15:56:0713347browse

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.

How to modify the character set in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to modify the character set in Linux

1. How to check the character set of the current Linux system

1.1. locale

1.2, echo $LANG

1.3, env |grep LANG

2. Check the character set supported by the current system

[root@localhost ~]# locale -a

##3. Modify the system character set

3.1 , Temporarily effective

For 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 effect

For 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/i18n

en_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


Related recommendations: "

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!

Statement:
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