Home >Operation and Maintenance >Linux Operation and Maintenance >What is the default encoding of linux
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".
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
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!