LinuxSir.cn,穿越时空的Linuxsir!

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

关于locale的设置

[复制链接]
发表于 2007-11-8 00:26:56 | 显示全部楼层 |阅读模式
我在/etc/env.d/02locale中设置了LANG变量为,"zh_CN.UTF-8",结果连控制台的显示都是zh_CN.UTF-8了,乱码;但是我以前用redhat,fc的时候,系统自己在/etc/sysconfig/i18n里也设置的是LANG="zh_CN.UTF-8",但是6个控制台locale都是en_US.UTF-8,用gdm登录后都是zh_CN.UTF-8,在gentoo下怎样实现这种效果呢?难道在02locale设置LANG="en_US.UTF-8"?我想要的是除了控制台,其他全部是中文utf8。。。怎样实现呢?请教,谢谢。
发表于 2007-11-8 00:46:26 | 显示全部楼层
前几天刚刚讨论过,你往后翻翻
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-11-8 12:11:04 | 显示全部楼层
论坛似乎还不能搜索,但是翻了10页,也看到了相关的几个讨论贴,还是不能解决问题。算了,先放着吧。。。认真看了一下,redhat (fc)里确实全局设置在i18n文件里设置LANG值,但同时它又根据consoletype设置不同的LANG值,结果就是控制台中有一个变量是consoletype=vt,结果LANG=en_US.UTF-8,consoletype=pty时,LANG=zh_CN.UTF-8。
回复 支持 反对

使用道具 举报

发表于 2007-11-8 13:41:21 | 显示全部楼层
laoliulaoliu的那个中文完美解决方案
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-11-9 14:11:05 | 显示全部楼层
Post by Reiase;1779237
laoliulaoliu的那个中文完美解决方案
感谢。似乎没找到。

补充一下:发现了一个细节,/etc/conf.d/keymaps有一个值$DUMPKEYS_CHARSET,我试着设置为iso-8859-1,发现可以了,虽然输出还是乱码中文,但是控制台菜单正常了。因为我是重装的系统,不知是不是和这有关系,有此问题的朋友不妨试试。
cat keymaps:

# /etc/conf.d/keymaps

# Use KEYMAP to specify the default console keymap.  There is a complete tree
# of keymaps in /usr/share/keymaps to choose from.

KEYMAP="us"


# Should we first load the 'windowkeys' console keymap?  Most x86 users will
# say "yes" here.  Note that non-x86 users should leave it as "no".

SET_WINDOWKEYS="no"


# The maps to load for extended keyboards.  Most users will leave this as is.

EXTENDED_KEYMAPS=""
#EXTENDED_KEYMAPS="backspace keypad euro2"


# Tell dumpkeys(1) to interpret character action codes to be
# from the specified character set.
# This only matters if you set UNICODE="yes" in /etc/rc.conf.
# For a list of valid sets, run `dumpkeys --help`

DUMPKEYS_CHARSET="iso-8859-1"


# Some fonts map AltGr-E to the currency symbol ¤ instead of the Euro €
# To fix this, set to "yes"

FIX_EURO="no"
cat /etc/rc.conf:
# /etc/rc.conf: Global startup script configuration settings

# UNICODE specifies whether you want to have UNICODE support in the console.  
# If you set to yes, please make sure to set a UNICODE aware CONSOLEFONT and
# KEYMAP in the /etc/conf.d/consolefont and /etc/conf.d/keymaps config files.

UNICODE="yes"

# You should set EDITOR and PAGER in a file in /etc/profile.d/ like "base.sh".

# XSESSION is a new variable to control what window manager to start
# default with X if run with xdm, startx or xinit.  The default behavior
# is to look in /etc/X11/Sessions/ and run the script in matching the
# value that XSESSION is set to.  The support scripts are smart enough to
# look in all bin directories if it cant find a match in /etc/X11/Sessions/,
# so setting it to "enlightenment" can also work.  This is basically used
# as a way for the system admin to configure a default system wide WM,
# allthough it will work if the user export XSESSION in his .bash_profile, etc.
#
# NOTE:  1) this behaviour is overridden when a ~/.xinitrc exists, and startx
#           is called.
#        2) even if ~/.xsession exists, if XSESSION can be resolved, it will
#           be executed rather than ~/.xsession, else KDM breaks ...
#
# Defaults depending on what you install currently include:
#
# Gnome - will start gnome-session
# kde-<version> - will start startkde (look in /etc/X11/Sessions/)
# Xsession - will start a terminal and a few other nice apps
# Xfce4 - will start a XFCE4 session

XSESSION="Xfce4"
cat /etc/env.d/02locale:
LANG="zh_CN.UTF-8"
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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