Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify the character set by linux

Shulou Source: shulou.com Published: 2022-05-31 11:09:44 11月14日 Update

Editor to share with you how to modify the linux character set, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

Methods: 1, use "LANG= character set" or "export LANG= character set" command to temporarily modify character set; 2, use "vi / etc/sysconfig/i18n" command to modify character set configuration file to modify character set permanently.

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

How to modify the character set of linux 1. View the character set method of the current linux system

1.1 、 locale

1.2, echo $LANG

1.3, env | grep LANG

Second, view the character sets supported by the current system

[root@localhost] # locale-a

Third, modify the system character set

Temporary effective # for example, the character set is modified to: zh_CN.gb2312

You can see that the system character set has been changed 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, if the character set is changed to zh_CN.gb2312, restart the system and reopen shell, it will not be invalidated

Cat / etc/sysconfig/i18n # View character set configuration file

Vi / etc/sysconfig/i18n # en_US.UTF-8 is modified to zh_CN.gb2312

Source / etc/sysconfig/i18n # # takes effect immediately. If you check the character set, it has become the modified

The above is all the contents of the article "how to modify the character set of linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Characters character sets systems articles content commands files methods permanent configuration not much most tutorials more environment computers knowledge industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Tech Info Apple Microsoft Docker