View the default encoding of the operating system

1. Windows operating system

        Enter the DOS window and enter: chcp


        You can get the code page information of the operating system, and you can view the detailed character set information corresponding to the code page from the language option of the control panel.

        For example: My active code page is: 936, and its encoding format is GBK.

 

2. Linux operating system

        To view supported character encodings, use the locale command, such as:

 

# 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"

        If it is changed to Chinese encoding, open and modify the /etc/sysconfig/i18n file, and set the

LANG = en_US.UTF-8

        change to

LANG="zh_CN.GBK"

        Just restart.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326519069&siteId=291194637