Let Redhat Linux directly display Chinese

xiaoxiao2021-03-06  83

I believe even if I have a very good friend of English, I am more accustomed to see Chinese. It is worthy of being, after the efforts of many people, Linux supports Chinese support is getting better and better. For example, I use Red Hat 6.2, without any patch, only by some settings, can display Chinese directly on the menu, title bar and other locations. I believe that other Linux issuings can also be displayed in Chinese through similar settings.

Below, I will briefly explain the steps of setting with the Red Hat 6.2 version.

1. Determine what version of LIBC you use

LIBC is a GNU C function library with LIBC 5 and LIBC 6. Early Linux distribution kits, mostly use libc 5 , such as slake, currently, almost all issuings are upgraded to libc 6, which is GLIBC 2, basically can handle Chinese normally. If there is a libc in the / lib directory. SO. 6 file, you can determine that libc version is glibc 2, otherwise your libc version is too old, it is recommended that you upgrade to the latest Glibc 2.2, upgrade method can refer to Howto of Glibc 2.

2. Check the font installation

To display Chinese, there must be a Chinese font, knock in the shell into the following instructions:

$ Xlsfonts | grep gb

-ISAS-FANGSONG TI-Medium-R-NORMAL - 0-0-72-72-C-0-GB2312.1980-0-Isas-Song Ti-Medium-R-Normal - 0-0-72-72 -C-0-GB2312.1980-0

Hanzigb16fs

Hanzigb16st

If there is a similar result output, then the system we need is installed in the system, you can perform the next setting directly; if there is no output, we need to install the font, you can download the GB lettering online and installation. Red Hat Linux 6.2 has been built into the Song and imitation Song, no need to install.

3. Define regional language settings

Surrounding the language settings in the system different parts of / usr / share / locale, we can see there is a zh_cn. GB2312 directory, but there is no necessary information below, we can go to / usr / share / i18n directory, here, the code, transformation information, etc. we need to find Charmaps / GB2312, Locales / ZH_CN, respectively. GB2312 and Repertoiremaps / Charids. 894 These three files, but because the 2.1 version of Glibc's support for double-byte text is not perfect, we are going to zh_cn. The GB2312 file is modified. This is a text file, first of all, using "%" to comment, and then a cumbersome step, change the definition of lc_monetary, lc_time, lc_mesetages in the file, as follows: lc_moetary

CP from en_dk

After end_monetary modified, run the following command:

$ Localedef -i zh_cn. GB2312 -F GB2312 - EC. 894 zh_cn. GB2312

The system will be in / usr / share / local / zh_cn. Generating area settings in the GB2312 directory, carefully readers must notice that GB is lowercase, this is not what I am wrong, the truth is the case; we also move the corresponding content to zh_cn. GB2312 directory.

$ Mv zh_cn. GB2312 /  zh_cn. GB2312

4. Modify system encoding transformation settings, tell the system how to convert Chinese characters to the system internal code

Find the EUC-CN string in the / usr / lib / gconv / gconv-modules file, approximately 880 lines, confirm that there is a line of GB2312, as shown in the third line:

# From to module costalias euccn // EUC-CN //

Alias ​​GB2312 // EUC-CN //

Alias ​​CN-GB // EUC-CN //

Module EUC-CN // Internal EUC-CN 1

Module Internal EUC-CN / / EUC-CN 1

5. Xfree86 settings

/ Usr / x11r6 / lib / x11 / locale is a directory of XFree86 storage area information, where the zh / xlc_locale file is Chinese character set information, we are in Locale. Add the following line to the Dir file:

ZH / XLC_LOCALE EN_CN. GB2312 Of course, better habits are new, create a new zh_cn. The directory of GB2312 copies the zh / xlc_locale file to the directory, and Locale. DIR changes to:

EN_CN. GB2312 / XLC_LOCALE

EN_CN. GB2312

6. Environmental variable setting

All is ready except for the opportunity. We just tell the system to use Chinese area settings, enter the following setting commands under the shell:

$ Lang = zh_cn. GB2312

OK, now re-enter the X-Window system, you should be able to see familiar Chinese! Is it very cool?

It is worth mentioning that the newly issued KDE 2.0 and gnome1.2 provide a relatively complete Chinese information, upgrade it!

From: Ozes

转载请注明原文地址:https://www.9cbs.com/read-107637.html

New Post(0)