分页: 1 / 1

[已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-06 15:55
itux
由于是在无法忍受机器在ubuntu 8.10下缓慢的反应,所以转用了轻量级的ARCH。因为有之前ubuntu的使用经验,所以安装以及配置ARCH并没有出现多大问题,基本上碰到的问题在wiki上面都可以找到答案。可是有一点至今还是无法解决,查了许多资料,是在不行了,在此向各位请教一下。

解决方法在6楼。

我的rc.conf文件中有关locale的设置是这样的:

代码: 全选

LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Canada/Pacific"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
另外修改了一下~/.profile以及~/.xinitrc
其中~/.profile文件配置如下:

代码: 全选

export LOCALE="zh_CN.utf8"
~/.xinitrc配置如下:

代码: 全选

export LOCALE="zh_CN.utf8"
而且在locale.gen文件中删掉了所有以zh_CN开头的行前面的'#',系统的中文字体包括wenquanyi以及uming。虽然显示网页以及阅读pdf文件均没有什么问题,但是查看文件夹下文件时中文文件名始终无法正确显示。

以下几张图就是明证,希望各位赐教。
整体界面预览
整体界面预览
网页显示情况
网页显示情况
中文文件名无法显示
中文文件名无法显示
pdf内中文显示正确
pdf内中文显示正确

Re: [问题]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-06 19:42
HuntXu
挂载的参数不对吧...
还有你在locale.gen注释掉zh_CN开头的行,zh_CN的locale还会被建立么...

Re: [问题]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-06 19:53
sfbi
估计是因为locale.gen里面把zh_CN给注释掉了。。。打开重新生成吧(locale-gen)。如果不是移动硬盘用的ntfs的话,那默认的fstab应该没问题。除非你自己又怎么改了。

Re: [问题]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-06 21:54
Wjian
同意楼上,就算以英这为主
locale,Locale.gen
里面zh-CN开头的不能注释掉,把
前面的井号去掉,重新运行下
locale-gen重建

Re: [问题]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-06 22:29
itux
各位,抱歉,我说错了,我不是将locale.gen所有以zh_CN开头的行注释掉了,而是将所有以zh_CN开头的行前面的#删掉了。这里没有说清楚,造成了误会,现在修改过来。

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-07 16:25
itux
修改~/.xinitrc以及~/.profile文件如下:

~/.xinitrc

代码: 全选

export LC_CTYPE="zh_CN.UTF-8"
~/.profile

代码: 全选

export LC_CTYPE="zh_CN.UTF-8"
rc.conf文件不需要更改,这样使用locale命名后会显示如下选项:

代码: 全选

LANG=en_US.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
PS:如2楼所说,由于挂载参数不对,所以在U盘里面中文显示不正确。因为是在rc.conf中设置自动挂载的,暂时还没有找到解决方法。

这样最终显示的效果见下图:
正确显示中文文件名
正确显示中文文件名
全景截图
全景截图

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-07 23:49
sfbi
.xinitrc 和 .xprofile 中的那几行根本没必要加,rc.conf跟挂载有什么关系?上贴中的比较混乱啊。。。

需要做的就是:rc.conf中用en_US.utf8,这是你自己选择的。
locale.gen里面把中文以及你需要的文字编码全部打开(至少 en 和 zh_CN得开),然后运行locale-gen

至于U盘挂载,跟这些没关系。手动mount一下看看行不行。如果是ntfs的话用ntfs-3g这个参数(得安装ntfs-3g)。如果是每次开机都挂载这个U盘,可以写进fstab

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-08 0:48
xjpvictor
u盘,在gconf-editor中,/system/storage/default_options/vfat,mount_options里加上utf8就好了

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-09 11:53
itux
xjpvictor 写了:u盘,在gconf-editor中,/system/storage/default_options/vfat,mount_options里加上utf8就好了
恩,谢谢,虽然之前已经在网络上查到相关的解决办法了。

现在所有的问题都解决了,用起来感觉也相当不错!

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-09 11:57
itux
sfbi 写了:.xinitrc 和 .xprofile 中的那几行根本没必要加,rc.conf跟挂载有什么关系?上贴中的比较混乱啊。。。

需要做的就是:rc.conf中用en_US.utf8,这是你自己选择的。
locale.gen里面把中文以及你需要的文字编码全部打开(至少 en 和 zh_CN得开),然后运行locale-gen

至于U盘挂载,跟这些没关系。手动mount一下看看行不行。如果是ntfs的话用ntfs-3g这个参数(得安装ntfs-3g)。如果是每次开机都挂载这个U盘,可以写进fstab
是这样阿,不过现在在.xinitrc以及.profile里面加入这些东西对于英文locale显示中文没有什么影响,所以就不想乱改了。而且初次使用arch,还有很多不懂的地方,能将系统调整到一个好的状态已经很满意了。那么这些配置文件什么的就不去动它了,乱点就乱点吧,无关痛痒,好用就行了。

还是谢谢你的指点。

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-09 13:35
yilan198711
mark

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-11 10:07
xzl_zl
请教楼主,右侧的状态显示是什么软件?

Re: [已解决]ARCH英文Locale下文中文文件名无法显示

发表于 : 2009-03-12 19:51
itux
xzl_zl 写了:请教楼主,右侧的状态显示是什么软件?
哦,这个是conky。一般直接安装的conky是很丑陋的,需要修改一下.conkyrc才好。网络上有许多的这样的文件,我把自己的贴在下面,你喜欢的话直接拿去用就好了。

代码: 全选

# UBUNTU-CONKY
# A comprehensive conky script, configured for use on
# Ubuntu / Debian Gnome, without the need for any external scripts.
#
# Based on conky-jc and the default .conkyrc.
# INCLUDES:
# - tail of /var/log/messages 
# - netstat connections to your computer
#
# -- Pengo (conky@pengo.us)
#

# Create own window instead of using desktop (required in nautilus)
own_window yes
own_window_hints undecorated,below,skip_taskbar
background no

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# fiddle with window
use_spacer yes
use_xft yes

# Update interval in seconds
update_interval 3.0

# Minimum size of text area
minimum_size 400 5

# Draw shades?
draw_shades yes

# Text stuff
draw_outline no # amplifies text if yes
draw_borders no

uppercase no # set to yes if you want all text to be in uppercase

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors, grey90 == #e5e5e5
default_color white
default_shade_color black
default_outline_color white

own_window_colour brown
own_window_transparent yes

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
gap_x 10
gap_y 10

# stuff after 'TEXT' will be formatted on screen

override_utf8_locale no
xftfont Terminus:size=8
xftalpha 0.8

TEXT

${offset 240}${color slate grey}${time %a, } ${color }${time %e %B %G}
${offset 240}${color slate grey}${time %Z,    }${color }${time %H:%M:%S}
${offset 240}${color slate grey}UpTime: ${color }$uptime
${offset 240}${color slate grey}Kern:${color }$kernel
${offset 240}${color slate grey}CPU:${color } $cpu% ${acpitemp}C
${offset 240}${cpugraph 20,130 000000 ffffff}
${offset 240}${color slate grey}Load: ${color }$loadavg
${offset 240}${color slate grey}Processes: ${color }$processes  
${offset 240}${color slate grey}Running:   ${color }$running_processes

${offset 240}${color slate grey}Highest CPU:
${offset 240}${color #ddaa00} ${top name 1}${top_mem cpu 1}
${offset 240}${color lightgrey} ${top name 2}${top cpu 2}
${offset 240}${color lightgrey} ${top name 3}${top cpu 3}
${offset 240}${color lightgrey} ${top name 4}${top cpu 4}

${offset 240}${color slate grey}Highest MEM:
${offset 240}${color #ddaa00} ${top_mem name 1}${top_mem mem 1}
${offset 240}${color lightgrey} ${top_mem name 2}${top_mem mem 2}
${offset 240}${color lightgrey} ${top_mem name 3}${top_mem mem 3}
${offset 240}${color lightgrey} ${top_mem name 4}${top_mem mem 4}

${offset 240}${color slate grey}MEM:  ${color } $memperc% $mem/$memmax
${offset 240}${membar 3,100}
${offset 240}${color slate grey}SWAP: ${color }$swapperc% $swap/$swapmax
${offset 240}${swapbar 3,100}

${offset 240}${color slate grey}ROOT:    ${color }${fs_free /}/${fs_size /}
${offset 240}${fs_bar 3,100 /}
${offset 240}${color slate grey}HOME:  ${color }${fs_free /home}/${fs_size /home}
${offset 240}${fs_bar 3,100 /home}
${offset 240}${color slate grey}KINGSTON:  ${color }${fs_free /media/KINGSTON}/${fs_size /media/KINGSTON}
${offset 240}${fs_bar 3,100 /media/KINGSTON}
${offset 240}${color slate grey}NET: 
${offset 240}${color}Up: ${color }${upspeed eth0} k/s
${offset 240}${upspeedgraph eth0 20,130 000000 ffffff}
${offset 240}${color}Down: ${color }${downspeed eth0}k/s${color}
${offset 240}${downspeedgraph eth0 20,130 000000 ffffff}