Author: stefsolu original address: http://hi.baidu.com/stefsolu/blog/item/4fe5a43280cfefa45fdf0ee4.html
Linux
Installation of the lower Character Set
Currently, encoding conversion is frequently encountered during project development.Linux
Generally, the Japanese language is encoded in EUC. How can this problem be solved?Linux
Do you know Japanese characters in shift_jis encoding? This requires thatLinux
Install shift_jis on (Linux
Operating System, also known as WINDOWS-31J) Character Set, see the following for details.
Linux
The following directories and files related to i18n (internationalization ):
- /Etc/sysconfig/i18n (file)
This file is used to configure the locale of the entire operating system. Just like locale in Windows, it can be used to configure the current language and character set. For example, a possible/etc/sysconfig/i18n file is as follows:
Lang = "ja_JP.WINDOWS-31J" (specifies the character set for the current operating system)
Supported = "ja_JP.WINDOWS-31J: ja_jp: Ja" (specifies the character set supported by the current operating system)
Sysfont = "lat0-sun16" (specifies the font of the current operating system)
- /Usr/share/i18n/charmaps (directory)
This directory storesLinux
If a character set is not installed on your operating system, you can find the installation package in this directory. For example, the installation package name of shift_jisis "“windows-31j.gz ".
- /Usr/share/i18n/locales (directory)
This directory stores Locale information that corresponds to all language packs. For example, the ja_JP.WINDOWS-31J is a complete character set where ja represents the language and JP represents the language
Language used by the country, the WINDOWS-31J represents the corresponding encoding of this language. /Usr/share/i18n/locales all have languages and libraries similar to ja_jp.
Information in the country.
- /Usr/lib/locale (directory)
This directory stores all the locale information that has been installed on the operating system.
Linux
Several shell commands related to i18n
- Locale command (used to view information about the system locale)
- Localedef command (used to install the system Locale information)
Linux
Example of installing the WINDOWS-31J under
- Step 1:Linux
Under the installation package directory of the character set
[Cd/usr/share/i18n/charmaps]
- Step 2: Decompress windows-31j.gz in the directory
[Gunzip WINDOWS-31J.gz]
- Step 3: Install character sets
[Localedef-F WINDOWS-31J-I ja_jp/usr/lib/locale/ja_jp.windows31j]
- Step 4: Check whether it has been defined
[Locale-A | grep windows31j]
- Step 5: After installation, you only need to modify the/etc/sysconfig/i18n file to modify the current character set to the newly installed windows31j character set.