Home >Operation and Maintenance >Linux Operation and Maintenance >What is the default encoding of linux

What is the default encoding of linux

WBOY
WBOYOriginal
2022-03-18 17:16:108931browse

The default encoding of Linux is "UTF-8"; you can use the "locale" command to view the default encoding of Linux. The displayed result is "LANG=en_US.UTF-8" and the language is "en_US" (American English ), the encoding is "UTF-8".

What is the default encoding of linux

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

What is the default encoding of linux

The locale command is used to set the locale in which the program runs.

locale Set the naming rule of the locale to Language_area.charset. For example, en_US.utf8 means that the language is English, the region is the United States, and the character set is UTF-8.

Check the default encoding of the linux system:

Use the locale command

[root@localhost ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"

Then modify /etc/sysconfig/i18n, such as changing to Chinese encoding:

vim /etc/sysconfig/i18n

Change LANG="en_US.UTF-8" to LANG="zh_CN.GBK". . Save and exit.

Restart.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What is the default encoding of 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