Modify the Linux default encoding __ios

Source: Internet
Author: User
Tags i18n locale


Modify the default encoding for Linux 2009-10-28 10:17

The default encoding for Windows is UTF-8, which is the default encoding for Gbk,linux. The Chinese that is edited under Windows, is displayed as garbled under Linux. To resolve this issue, the default encoding for modifying Linux is GBK. The method is as follows:

Method 1:

vi/etc/sysconfig/i18n

Lang= "ZH_CN. GBK "
Supported= "ZH_CN. Utf-8:zh_cn:zh "
Sysfont= "Latarcyrheb-sun16"

Method 2:
Vi/etc/profile

Export Lc_all= "ZH_CN. GBK "
Export lang= "ZH_CN.GBK"


run the locale command to get detailed information about the current system encoding settings.

First, the organs of locale

1. Language symbols and their classifications (LC_CTYPE)
2. Number (Lc_numeric)
3, Comparison and sorting habits (lc_collate)
4, Time display format (lc_time)
5. Monetary unit (lc_monetary)
6, the information is mainly prompted information, error messages, status information, title, tags, buttons and menus, etc. (lc_messages)
7. Name writing method (Lc_name)
8. Address writing method (lc_address)
9. Telephone number Writing method (Lc_telephone)
10, weights and measures of expression (lc_measurement)
11. Default paper Size (lc_paper)
12, the locale itself contains information overview (lc_identification).

Second, understand the setting of locale

Set locale is to set 12 categories of locale classification attributes, that is, 12 lc_*. In addition to the 12 variables that can be set, there are two variables for simplicity: Lc_all and Lang.

There is a priority relationship between them: Lc_all > Lc_* > LANG

It can be said that Lc_all is the most superior set or mandatory setting, and Lang is the default set value.

Three specific sets of Locale method (ZH_CN. UTF-8, ZH_CN. GBK)

FreeBSD settings:

1.GDM login changed to terminal login StartX start graphics desktop

2. Add the following statement to the ~/.CSHRC (set accordingly according to the shell you are using)

Setenv LANG ZH_CN. GBK
Setenv Lc_all ZH_CN. GBK
Setenv lc_ctype ZH_CN. GBK

3. Modify the default values for/etc/fstab:

Linux settings:

1. Modify/etc/sysconfig/i18n file, lang= "ZH_CN. UTF-8 "or lang=" ZH_CN. GBK "

Normal User modification ~/.profile

...
Export LANG zh_cn. GBK
...

2. Modify the default value of/etc/fstab

Modify the default encoding for Linux 2009-10-28 10:17

The default encoding for Windows is UTF-8, which is the default encoding for Gbk,linux. The Chinese that is edited under Windows, is displayed as garbled under Linux. To resolve this issue, the default encoding for modifying Linux is GBK. The method is as follows:

Method 1:

vi/etc/sysconfig/i18n

Lang= "ZH_CN. GBK "
Supported= "ZH_CN. Utf-8:zh_cn:zh "
Sysfont= "Latarcyrheb-sun16"

Method 2:
Vi/etc/profile

Export Lc_all= "ZH_CN. GBK "
Export lang= "ZH_CN.GBK"


run the locale command to get detailed information about the current system encoding settings.

First, the organs of locale

1. Language symbols and their classifications (LC_CTYPE)
2. Number (Lc_numeric)
3, Comparison and sorting habits (lc_collate)
4, Time display format (lc_time)
5. Monetary unit (lc_monetary)
6, the information is mainly prompted information, error messages, status information, title, tags, buttons and menus, etc. (lc_messages)
7. Name writing method (Lc_name)
8. Address writing method (lc_address)
9. Telephone number Writing method (Lc_telephone)
10, weights and measures of expression (lc_measurement)
11. Default paper Size (lc_paper)
12, the locale itself contains information overview (lc_identification).

Second, understand the setting of locale

Set locale is to set 12 categories of locale classification attributes, that is, 12 lc_*. In addition to the 12 variables that can be set, there are two variables for simplicity: Lc_all and Lang.

There is a priority relationship between them: Lc_all > Lc_* > LANG

It can be said that Lc_all is the most superior set or mandatory setting, and Lang is the default set value.

Three specific sets of Locale method (ZH_CN. UTF-8, ZH_CN. GBK)

FreeBSD settings:

1.GDM login changed to terminal login StartX start graphics desktop

2. Add the following statement to the ~/.CSHRC (set accordingly according to the shell you are using)

Setenv LANG ZH_CN. GBK
Setenv Lc_all ZH_CN. GBK
Setenv lc_ctype ZH_CN. GBK

3. Modify the default values for/etc/fstab:

Linux settings:

1. Modify/etc/sysconfig/i18n file, lang= "ZH_CN. UTF-8 "or lang=" ZH_CN. GBK "

Normal User modification ~/.profile

...
Export LANG zh_cn. GBK
...

2. Modify the default value of/etc/fstab

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.