LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2262|回复: 20

如何将自己的locale改成gb18030呀!!!

[复制链接]
发表于 2002-12-9 16:24:23 | 显示全部楼层 |阅读模式
我选择简体中文(不是UTF-8)装的MDK9.0,然后安照<完全美化,修订一>进行了美化,多次之后,效果不好!!

修订一中的locale设置该是什么呢??是gb18030呢/??还是gb2312呢??

我看里面好多地方改的都是用18030,而我的locale是2312,是不是因为这个我不能很好的美化呢??

怎么改呢??
发表于 2002-12-9 22:39:21 | 显示全部楼层
将 /etc/sysconfig/i18n 文件的内容作如下修改:
原文件内容:

LC_CTYPE=zh_CN.GB2312
CONSOLE_NOT_LOCALIZED=yes
LANGUAGE=zh_CN.GB2312:zh_CN:zh
ENC=gb
LC_MONETARY=zh_CN.GB2312
XIM_PROGRAM=chinput
LC_COLLATE=zh_CN.GB2312
XIM=Chinput
LC_NUMERIC=zh_CN.GB2312
LC_TIME=zh_CN.GB2312
LANG=zh_CN.GB2312
XMODIFIERS="@im=Chinput"
LC_MESSAGES=zh_CN.GB2312

修改后文件内容:

LC_CTYPE=zh_CN.GB18030
CONSOLE_NOT_LOCALIZED=yes
LANGUAGE=zh_CN.GB18030:zh_CN:zh
ENC=gb
LC_MONETARY=zh_CN.GB18030
XIM_PROGRAM=chinput
LC_COLLATE=zh_CN.GB18030
XIM=Chinput
LC_NUMERIC=zh_CN.GB18030
LC_TIME=zh_CN.GB18030
LANG=zh_CN.GB18030
XMODIFIERS="@im=Chinput"
LC_MESSAGES=zh_CN.GB18030


另一方法:
修改 /etc/rc.local文件:
原内容:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

[ -f /etc/sysconfig/msec ] && source /etc/sysconfig/msec
[ -z "$SECURE_LEVEL" ] && SECURE_LEVEL=3

# Source functions
. /etc/init.d/functions

if [ -f /etc/mandrake-release -a $SECURE_LEVEL -lt 4 ]; then
    R=$(cat /etc/mandrake-release)

    arch=$(uname -m)
    a="a"
    case "_$arch" in
            _a*) a="an";;
            _i*) a="an";;
    esac
   
    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
    if [ "$NUMPROC" -gt "1" ]; then
        SMP="$NUMPROC-processor "
        [ "$NUMPROC" = "2" ] && \
        SMP="Dual-processor "
        if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
            a="an"
        else
            a="a"
        fi
    fi

    # This will overwrite /etc/issue at every boot.  So, make any changes you
    # want to make to /etc/issue here or you will lose them when you reboot.

    if [ -x /usr/bin/linux_logo ];then
        /usr/bin/linux_logo -c -n -f | sed -e 's|\\|\\\\|g' > /etc/issue
        echo "" >> /etc/issue
    else
        > /etc/issue
    fi
    echo "$R" >> /etc/issue
    echo "Kernel $(uname -r) on $a $SMP$(uname -m) / \l" >> /etc/issue
   
    if [ "$SECURE_LEVEL" -le 3 ];then
        echo "Welcome to ${HOST}" > /etc/issue.net
        echo "$R" >> /etc/issue.net
        echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue.net
    else       
        echo "Welcome to Mandrake Linux" > /etc/issue.net
        echo "-------------------------" >> /etc/issue.net
    fi
elif [ $SECURE_LEVEL -ge 4 ]; then
    rm -f /etc/issue /etc/issue.net
fi

touch /var/lock/subsys/local

修改后:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

[ -f /etc/sysconfig/msec ] && source /etc/sysconfig/msec
[ -z "$SECURE_LEVEL" ] && SECURE_LEVEL=3

# Source functions
. /etc/init.d/functions

if [ -f /etc/mandrake-release -a $SECURE_LEVEL -lt 4 ]; then
    R=$(cat /etc/mandrake-release)

    arch=$(uname -m)
    a="a"
    case "_$arch" in
            _a*) a="an";;
            _i*) a="an";;
    esac
   
    NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
    if [ "$NUMPROC" -gt "1" ]; then
        SMP="$NUMPROC-processor "
        [ "$NUMPROC" = "2" ] && \
        SMP="Dual-processor "
        if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
            a="an"
        else
            a="a"
        fi
    fi

    # This will overwrite /etc/issue at every boot.  So, make any changes you
    # want to make to /etc/issue here or you will lose them when you reboot.

    if [ -x /usr/bin/linux_logo ];then
        /usr/bin/linux_logo -c -n -f | sed -e 's|\\|\\\\|g' > /etc/issue
        echo "" >> /etc/issue
    else
        > /etc/issue
    fi
    echo "$R" >> /etc/issue
    echo "Kernel $(uname -r) on $a $SMP$(uname -m) / \l" >> /etc/issue
   
    if [ "$SECURE_LEVEL" -le 3 ];then
        echo "Welcome to ${HOST}" > /etc/issue.net
        echo "$R" >> /etc/issue.net
        echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue.net
    else       
        echo "Welcome to Mandrake Linux" > /etc/issue.net
        echo "-------------------------" >> /etc/issue.net
    fi
elif [ $SECURE_LEVEL -ge 4 ]; then
    rm -f /etc/issue /etc/issue.net
fi

touch /var/lock/subsys/local

LC_LANG=zh_CN.GB18030
LC_ALL=zh_CN.GB18030
发表于 2002-12-10 11:11:55 | 显示全部楼层
我用的是G五笔,照你第一种方法修改后,启动不了KDE,没办法只好改过来了,的操作系统是MDK9。
第二种方法暂且就不且了罢。
对了,我也对照北南兄的方法作了美,可也不是很满意,特别是英文 。
发表于 2002-12-10 16:56:53 | 显示全部楼层
不太好,我们可以再美化。可以用dl59兄的办法来试一下。
另外GB编码的问题,还得请兄弟多动一下,实践还是极为重要的。
发表于 2002-12-10 18:28:27 | 显示全部楼层
好像MDK9不支持GB18030(我把SIMSUN_18030字体装进行后,MDK9.0对GB18030.2000.0的编码并不能识别),当你用第一种方法后是不能成功的!
发表于 2002-12-10 19:22:28 | 显示全部楼层
以现在国外发行版,RedHat8.0支持GB2312、GBK,Mandrake只支持GB2312。如要实现支持GB18030编码,要对字体模块进行修改,才可以,这是相当复杂工作。在写“完全Mandrake 9.0 美化”时,我有野心想它支持GB18030编码,但我没能力完成,希望有心人可以完成它。
发表于 2002-12-13 01:14:30 | 显示全部楼层
希望dl59兄再接再励哦。
BTW:按老兄的方法美化Mandrake,发现升级了moailla1.2.2和phoenix0.5并不支持simsun,老兄如解决的?而且,有些系统会死掉,搞得我重新安装了整个系统。
发表于 2002-12-14 11:19:06 | 显示全部楼层

让Mandrake Linux 9.0实际GB18030编码的方法:

其实Mandrake Linux 9.0中自带有对GB18030支持的编码,其路径为:
/usr/X11R6/lib/X11/fonts/encodings/large/gb18030.2000-1.enc.gz
原/etc/X11/encodings.dir内容:
69
dec-special /usr/X11R6/lib/X11/fonts/encodings/dec-special.enc.gz
iso8859-6_8 /usr/X11R6/lib/X11/fonts/encodings/iso8859-6_8.enc.gz
koi8-k /usr/X11R6/lib/X11/fonts/encodings/koi8-k.enc.gz
ksxjohab-1 /usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1992-3.enc.gz
koi8-t /usr/X11R6/lib/X11/fonts/encodings/koi8-t.enc.gz
iransystem-0 /usr/X11R6/lib/X11/fonts/encodings/iransystem.enc.gz
big5.eten-0 /usr/X11R6/lib/X11/fonts/encodings/large/big5.eten-0.enc.gz
viscii1.1-1 /usr/X11R6/lib/X11/fonts/encodings/viscii1.1-1.enc.gz
microsoft-cp1258 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1258.enc.gz
tcvn-5712 /usr/X11R6/lib/X11/fonts/encodings/tcvn-5712.enc.gz
microsoft-cp1252 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1252.enc.gz
microsoft-cp1253 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1253.enc.gz
microsoft-cp1250 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1250.enc.gz
microsoft-cp1251 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1251.enc.gz
microsoft-cp1256 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1256.enc.gz
microsoft-cp1257 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1257.enc.gz
microsoft-cp1254 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1254.enc.gz
mulelao-1 /usr/X11R6/lib/X11/fonts/encodings/mulelao-1.enc.gz
microsoft-cp1255 /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1255.enc.gz
jisx0212.1990-0 /usr/X11R6/lib/X11/fonts/encodings/large/jisx0212.1990-0.enc.gz
jisx0208.1990-0 /usr/X11R6/lib/X11/fonts/encodings/large/jisx0208.1990-0.enc.gz
big5.cp950-0 /usr/X11R6/lib/X11/fonts/encodings/large/big5.eten-0.enc.gz
jisx0208.1983-0 /usr/X11R6/lib/X11/fonts/encodings/large/jisx0208.1983-0.enc.gz
big5-0 /usr/X11R6/lib/X11/fonts/encodings/large/big5.eten-0.enc.gz
gb2312.1980-0 /usr/X11R6/lib/X11/fonts/encodings/large/gb2312.1980-0.enc.gz
urdunaqsh-0 /usr/X11R6/lib/X11/fonts/encodings/urdunaqsh-0.enc.gz
adobe-symbol /usr/X11R6/lib/X11/fonts/encodings/adobe-symbol.enc.gz
adobe-standard /usr/X11R6/lib/X11/fonts/encodings/adobe-standard.enc.gz
microsoft-ansi /usr/X11R6/lib/X11/fonts/encodings/microsoft-cp1252.enc.gz
misc-fontspecific /usr/X11R6/lib/X11/fonts/encodings/microsoft-win3.1.enc.gz
microsoft-fontspecific /usr/X11R6/lib/X11/fonts/encodings/microsoft-win3.1.enc.gz
geo8-ps /usr/X11R6/lib/X11/fonts/encodings/georgian-ps.enc.gz
tis620-2 /usr/X11R6/lib/X11/fonts/encodings/tis620-2.enc.gz
tis620-0 /usr/X11R6/lib/X11/fonts/encodings/iso8859-11.enc.gz
tis620.2529-1 /usr/X11R6/lib/X11/fonts/encodings/iso8859-11.enc.gz
ascii-0 /usr/X11R6/lib/X11/fonts/encodings/microsoft-win3.1.enc.gz
ansi-0 /usr/X11R6/lib/X11/fonts/encodings/microsoft-win3.1.enc.gz
armscii-8 /usr/X11R6/lib/X11/fonts/encodings/armscii-8.enc.gz
georgian-rs /usr/X11R6/lib/X11/fonts/encodings/georgian-academy.enc.gz
gbk-0 /usr/X11R6/lib/X11/fonts/encodings/large/gbk-0.enc.gz
georgian-ps /usr/X11R6/lib/X11/fonts/encodings/georgian-ps.enc.gz
georgian-academy /usr/X11R6/lib/X11/fonts/encodings/georgian-academy.enc.gz
mulearabic-2 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-2.enc.gz
tis620.2533-0 /usr/X11R6/lib/X11/fonts/encodings/iso8859-11.enc.gz
mulearabic-0 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-0.enc.gz
mulearabic-1 /usr/X11R6/lib/X11/fonts/encodings/mulearabic-1.enc.gz
tis620.2533-1 /usr/X11R6/lib/X11/fonts/encodings/iso8859-11.enc.gz
iso8859-6.8x /usr/X11R6/lib/X11/fonts/encodings/iso8859-6_8.enc.gz
ibm-cp1133 /usr/X11R6/lib/X11/fonts/encodings/ibm-cp1133.enc.gz
jisx0201.1976-0 /usr/X11R6/lib/X11/fonts/encodings/large/jisx0201.1976-0.enc.gz
iso8859-9e /usr/X11R6/lib/X11/fonts/encodings/iso8859-9e.enc.gz
ksc5601.1987-0 /usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1987-0.enc.gz
geo8-bpg /usr/X11R6/lib/X11/fonts/encodings/georgian-academy.enc.gz
ksx1001.1997-3 /usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1992-3.enc.gz
ibm-cp437 /usr/X11R6/lib/X11/fonts/encodings/ibm-cp437.enc.gz
tcvn-0 /usr/X11R6/lib/X11/fonts/encodings/tcvn-0.enc.gz
tcvn-1 /usr/X11R6/lib/X11/fonts/encodings/tcvn-5712.enc.gz
ksc5601.1992-3 /usr/X11R6/lib/X11/fonts/encodings/large/ksc5601.1992-3.enc.gz
microsoft-win3.1 /usr/X11R6/lib/X11/fonts/encodings/microsoft-win3.1.enc.gz
tatar-cyr /usr/X11R6/lib/X11/fonts/encodings/tatar-cyr.enc.gz
ibm-cp852 /usr/X11R6/lib/X11/fonts/encodings/ibm-cp852.enc.gz
ibm-cp866 /usr/X11R6/lib/X11/fonts/encodings/ibm-cp866.enc.gz
ibm-cp850 /usr/X11R6/lib/X11/fonts/encodings/ibm-cp850.enc.gz
iso8859-16 /usr/X11R6/lib/X11/fonts/encodings/iso8859-16.enc.gz
iso8859-14 /usr/X11R6/lib/X11/fonts/encodings/iso8859-14.enc.gz
iso8859-13 /usr/X11R6/lib/X11/fonts/encodings/iso8859-13.enc.gz
isiri-3342 /usr/X11R6/lib/X11/fonts/encodings/isiri-3342.enc.gz
iso8859-11 /usr/X11R6/lib/X11/fonts/encodings/iso8859-11.enc.gz
adobe-dingbats /usr/X11R6/lib/X11/fonts/encodings/adobe-dingbats.enc.gz
在这个文件最后加入以下行,使之支持对GB18030的解释:
gb18030.2000-1 /usr/X11R6/lib/X11/fonts/encodings/large/gb18030.2000-1.enc.gz

然后再在支持gb18030字体解释器(fonts.dir)中加入对GB18030的解释,如:
simsun.ttf -simsun-simsun-medium-r-normal--0-0-0-0-c-0-gb18030.2000-1
以上操作我在Mandrake Linux 9.0中成功实践。
发表于 2002-12-14 16:44:06 | 显示全部楼层
我找不到/usr/X11R6/lib/X11/fonts/encodings/large/gb18030.2000-1.enc.gz,它在哪个包里啊。
发表于 2002-12-14 17:27:04 | 显示全部楼层

gb18030.2000-1.enc.gz 文件下载:

gb18030.2000-1.enc.gz 文件下载
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表