How to check the default code of linux
This article mainly introduces "how to view the default code of linux". In daily operation, I believe many people have doubts about how to view the default code of linux. Xiaobian consulted all kinds of information and sorted out simple and easy to use operation methods. I hope to answer your doubts about "how to view the default code of linux". Next, please follow the small series to learn together!
The default encoding for linux is "UTF-8"; you can use the "locale" command to view the default encoding for linux, which shows "LANG=en_US. UTF-8" for the language "en_US"(American English) and the encoding "UTF-8."
Operating environment: Linux 7.3 system, Dell G3 computer.
Linux default encoding
The locale command is used to set the locale in which the program runs.
locale The naming rule for setting the locale is Language_area.charset, for example en_US.utf8 indicates that the language is English, the region is the United States, and the character set is UTF-8.
Check out the Linux system default code:
Using the locale command
[root@localhost ~]# localeLANG=en_US.UTF-8LC_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 code:
vim /etc/sysconfig/i18n
Replace LANG="en_US. UTF-8" with LANG="zh_CN.GBK". Save and exit.
Restart.
At this point, the study of "how to view the default code of linux" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!