Debian System learning Note (3): Locale

Source: Internet
Author: User
Tags posix printable characters

3.Modifying the system language environment

(1) According to the dpkg package after the set language

#apt-getinstall dpkg

#dpkg-reconfigure locales

Select:en_us. UTF-8 UTF-8 confirm OKto add English language pack

Remote Console Chinese display normal settings, need to join:

[*]zh_cn GB2312 [*]ZH_CN. GB18030 GB18030 [*]ZH_CN. GBK GBK [*]ZH_CN. UTF-8 UTF-8


To view language information, if English, configure the information:

Lang= "en_US. UTF-8 "// put all the . Changed to en_US before UTF-8.

if Chinese, configure the information:

Lang= "ZH_CN. UTF-8 "

# Locale-gen // generate the required locale file

#echo $LANG // View

# Locale-gen--purge Regenerate locale support file

(3 ) system default language


#LANG = "en_US. UTF-8 "

Language= "En_us:en"

### can be modified into:

Lang= "ZH_CN. UTF-8 "

Language= "POSIX"

(4 ) System User Environment extension

Append #vim/etc/profile # at the end:

Export. UTF-8

Export Language=posix


# locale

(5)securecrt Character Set

# # # Operating system configuration:

$ LANG for:/etc/profile

# echo $LANG

en_US. UTF-8 or :zh_cn. UTF-8 # can extend exportlang=zh_cn in/etc/profile. UTF-8

# Grep-ev ' ^$|^# '/etc/locale.gen

en_US. UTF-8 UTF-8

Zh_cn. UTF-8 UTF-8

# # # SECURECRT configuration:

Options --- session options --- appearance --- character set:UTF-8

(6) about tool Sccurefx Chinese garbled processing

usually everyone likes to copy a session and then modify it, this will appear Securefx created the Chinese directory or file Linux system is not recognized,Linux The Chinese name directory or file Securefx created under the system is not recognized. Because the Securefx is not very good for the character encoding of the FTP server, it is necessary to enforce the UTF8 encoding format in the Session configuration file , and this setting is in the GUI no configuration is found on the interface, so it can only be modified manually the configuration in the Session file is resolved as follows:

"Filenames always UseUTF8" =00000000 modified to:"Filenames always use UTF8" =00000001

However, the new connection created manually does not have this problem

(7)locale language Environment Description

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


### Description: locale divides the various aspects of the cultural tradition involved into three major categories, namely:

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 informational, 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)

Theexpression of weights and measures (lc_measurement)

One, default paper size (lc_paper)

An overview of the locale itself containing information (lc_identification).

### For Example:

What the hell is zh_cn.gb2312 talking about? locale is the language of the software at runtime , including language (Language), Geography (Territory), and Character set (CodeSet). The writing format for a locale is: language [_ region [. Character Set ]]. So,the locale is always associated with a certain set of characters. Here are a few examples:

I speak Chinese, in the People's Republic of China, using the GB 2312 character set to express characters. zh_cn.gb2312= Chinese _ People's Republic of China + GB 2312 character Set.

one of the most closely related to Chinese input is Lc_ctype,lc_ctype Specifies the valid characters in the system and the classification of these characters, such as what is uppercase letters, lowercase letters, case conversions, punctuation, printable characters, and other character attributes. the most important thing in locale-defined ZH_CN is the definition of a large class of Chinese characters (class"hanzi") , and of course Unicode describes, which allows Chinese characters to be valid characters in a Linux system, regardless of the character set they are encoded in.

### How to set locale it?

set locale 12 12 lc_*< Span style= "font-family: ' The song Body '; > In addition to this 12 variables can be set aside, for simplicity, there are also two variables: lc_all and Lang lc_all lang is the default setting value.

1 , If you set the Lc_all=zh_cn. UTF-8, then regardless of lc_* and LANG set to what value, they will be forced to obey Lc_all settings, become zh_cn. UTF-8.

2 , If you set the LANG=zh_cn. UTF-8, while the other Lc_*=en_us. UTF-8, and without setting Lc_all , the system locale is set to Lc_*=en_us. UTF-8.

3 , = zh_cn. Utf-8 lc_* Lc_all Lc_* lang value ZH_CN. Utf-8

4 , = zh_cn. Utf-8 Lc_ctype=en_us. Utf-8 lc_* Lc_all setting will be: Lc_ctype=en_us. Utf-8 lc_collate lc_messages< Span style= "font-family: ' The song Body '; > And so on will take the default value, that is lang lc_collate = Lc_messages= ... = Lc_paper= lang= zh_cn. Utf-8

### So, thelocale It is set up in this way:

1 , If you need a pure Chinese system, set Lc_all=zh_cn. XXXX, or lang=zh_cn. XXXX can, of course, you can set both, but as mentioned above,the value of Lc_all will cover all other locale settings, do not work hard.

2 , = zh_cn. Xxxx Lang=en_us. Xxxx Yes. This way lc_ctype= zh_cn. Xxxx lc_collate= lc_messages< Span style= "font-family: ' The song Body '; >= ... = Lc_paper= lang= en_US. Xxxx

3 , Lc_* One by one set the value you need, Create an ancient Spirit system: lc_ctype= zh_cn. GBK/GBK ( gbk " using the digital system of Great Britain ) [email protected] ( German weights and measures use Iso-8859-15 character set ) Roman address writing method, American paper setting .... No one is expected to do it.

4 , If you don't do anything, it's Lc_all,LANG and lc_* do not specify a specific value, the system will use POSIX as the Lcoale, which is the C locale.

# # LANG and LANGUAGE What difference does it have?

Lang-specifies the default locale for Allunset locale variables

Language-most programs use of the Languageof its interface

LANGUAGE is the interface language for setting up the application. LANG is a variable with a low priority, which specifies the default values for all locale -related variables.

# # # some source network

This article is from the "Old Wafangdian" blog, please be sure to keep this source

Debian System learning Note (3): Locale

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: 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.