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

其他Linux/Unix/BSD/OSX等发行版讨论
回复
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#1

帖子 itux » 2009-03-06 15:55

由于是在无法忍受机器在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内中文显示正确
上次由 itux 在 2009-03-07 16:10,总共编辑 2 次。
头像
HuntXu
帖子: 5776
注册时间: 2007-09-29 3:09

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

#2

帖子 HuntXu » 2009-03-06 19:42

挂载的参数不对吧...
还有你在locale.gen注释掉zh_CN开头的行,zh_CN的locale还会被建立么...
HUNT Unfortunately No Talent...
头像
sfbi
帖子: 796
注册时间: 2007-09-06 11:41
来自: Bergen

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

#3

帖子 sfbi » 2009-03-06 19:53

估计是因为locale.gen里面把zh_CN给注释掉了。。。打开重新生成吧(locale-gen)。如果不是移动硬盘用的ntfs的话,那默认的fstab应该没问题。除非你自己又怎么改了。
Wjian
帖子: 2044
注册时间: 2005-08-07 18:34
系统: android 4.2.1
来自: 湛江

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

#4

帖子 Wjian » 2009-03-06 21:54

同意楼上,就算以英这为主
locale,Locale.gen
里面zh-CN开头的不能注释掉,把
前面的井号去掉,重新运行下
locale-gen重建
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#5

帖子 itux » 2009-03-06 22:29

各位,抱歉,我说错了,我不是将locale.gen所有以zh_CN开头的行注释掉了,而是将所有以zh_CN开头的行前面的#删掉了。这里没有说清楚,造成了误会,现在修改过来。
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#6

帖子 itux » 2009-03-07 16:25

修改~/.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中设置自动挂载的,暂时还没有找到解决方法。

这样最终显示的效果见下图:
正确显示中文文件名
正确显示中文文件名
全景截图
全景截图
头像
sfbi
帖子: 796
注册时间: 2007-09-06 11:41
来自: Bergen

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

#7

帖子 sfbi » 2009-03-07 23:49

.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
头像
xjpvictor
帖子: 2837
注册时间: 2007-08-22 15:55
系统: Archlinux
来自: 新加坡
联系:

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

#8

帖子 xjpvictor » 2009-03-08 0:48

u盘,在gconf-editor中,/system/storage/default_options/vfat,mount_options里加上utf8就好了
Entschuldigung. Ich habe keine ahnung.
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#9

帖子 itux » 2009-03-09 11:53

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

现在所有的问题都解决了,用起来感觉也相当不错!
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#10

帖子 itux » 2009-03-09 11:57

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,还有很多不懂的地方,能将系统调整到一个好的状态已经很满意了。那么这些配置文件什么的就不去动它了,乱点就乱点吧,无关痛痒,好用就行了。

还是谢谢你的指点。
头像
yilan198711
帖子: 1635
注册时间: 2008-06-22 13:38
来自: 武汉

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

#11

帖子 yilan198711 » 2009-03-09 13:35

mark
mint+gnome
xzl_zl
帖子: 58
注册时间: 2006-01-25 16:55

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

#12

帖子 xzl_zl » 2009-03-11 10:07

请教楼主,右侧的状态显示是什么软件?
头像
itux
帖子: 223
注册时间: 2008-01-10 14:03

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

#13

帖子 itux » 2009-03-12 19:51

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}
回复