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 |