How to modify the linux character set

青灯夜游
Release: 2022-03-09 16:51:48
Original
6840 people have browsed it

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
Copy after login

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
Copy after login

Extended knowledge: linux view character set

Common methods:

(1)

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

(2)

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

(3)

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

(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=
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!