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

How to modify the linux character set

青灯夜游
青灯夜游Original
2022-03-09 16:50:466949browse

Modification method: 1. Execute the "export LANG=Character Set" statement to temporarily modify the character set; 2. Open the "/etc/sysconfig/i18n" file, set "LANG="Character Set"" and "SYSFONT="latarcyrheb-sun16"" can permanently modify the character set.

How to modify the linux character set

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

linux modify character set

1. Temporary modification

Modify the way to directly set variables , only works temporarily for this shell

export LANG=zh_CN.UTF-8

2, takes effect permanently

Modify the file method, control the current machine by modifying the /etc/sysconfig/i18n file Permanently effective

[root@devhxyw03 ~]# vim /etc/sysconfig/i18n

LANG="zh_CN.GBK" 
SYSFONT="latarcyrheb-sun16" 

[root@devhxyw03 ~]# source /etc/sysconfig/i18n

Extended knowledge: linux view character set

Common methods:

(1)

[root@devhxyw03 ~]# echo $LANG zh_CN.GBK

(2)

[root@devhxyw03 ~]# env | grep LANG LANG=zh_CN.GBK

(3)

[root@devhxyw03 ~]# export | grep LANG declare -x LANG="zh_CN.GBK"

(4)

[root@devhxyw03 ~]# locale
LANG=zh_CN.GBK
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of How to modify the linux character set. 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