Create a new file under Linux, or use fopen new, what is the encoding of the file?
Linux system default language code is as follows
# cat/etc/sysconfig/i18n
Lang= "en_US. UTF-8 "
Sysfont= "Latarcyrheb-sun16"
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).
"[Email protected]]$ 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 "
Lc_all=
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.
Linux file encoding