Linux System Modification Code

Source: Internet
Author: User

The default encoding for Windows Gbk,linux is UTF-8. The Chinese, which is edited under Windows, is garbled under Linux. To resolve this issue, modify the default encoding for Linux to GBK. Here's how:

Method 1:

vi/etc/sysconfig/i18n

The default is:

Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"

modified to:

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 the details of the current system encoding settings.

First, the organs of the locale

1. Language symbols and their classification (LC_CTYPE)
2, Digital (lc_numeric)
3. Comparison and sequencing habits (lc_collate)
4. Time display format (lc_time)
5. Monetary unit (lc_monetary)
6, information is mainly information, error information, 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. Expression of weights and measures (lc_measurement)
11. Default paper Size (lc_paper)
12. An overview of the locale itself containing information (lc_identification).

Second, understand the setting of locale

Setting locale is the setting of 12 categories of locale classification attributes, that is, 12 lc_*. In addition to these 12 variables can be set, for the sake of simplicity, there are two variables: lc_all and lang.

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

As you can say, Lc_all is the most advanced setting or mandatory setting, and Lang is the default setting value.

Three ways to specify locale (ZH_CN. UTF-8, ZH_CN. GBK)

Settings for FreeBSD:

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

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

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

3. Modify the default value of the/etc/fstab:

Linux settings:

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

Normal User Modified ~/.profile

...
Export LANG zh_cn. GBK
...

2. Modify the default value of the/etc/fstab

Linux System Modification Code

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.