LinuxSir.cn,穿越时空的Linuxsir!

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

[Solved]Konsole能正常显示中文文件名,但在Dolphin和Konqueror中乱码

[复制链接]
发表于 2010-5-13 10:29:01 | 显示全部楼层 |阅读模式
在Konsole中能正常显示中文。
http://imagebin.org/96641

但在Dolphin中却是乱码。
http://imagebin.org/96642

$locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

请问这是怎么一回事?
发表于 2010-5-13 12:47:10 | 显示全部楼层
Dolphin 不支持中文?
回复 支持 反对

使用道具 举报

发表于 2010-5-14 09:37:53 | 显示全部楼层
Post by kpld;2089765
Dolphin 不支持中文?

不是,我的kde里边正常,无论是konsole还是dolphin里边。
回复 支持 反对

使用道具 举报

发表于 2010-5-14 09:57:20 | 显示全部楼层
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-14 11:45:39 | 显示全部楼层
我的Dolphin和Konqueror是4.3.5,为什么还是有这个问题呢?
请问应如何解决。谢谢。
回复 支持 反对

使用道具 举报

发表于 2010-5-14 12:20:03 | 显示全部楼层
Post by phoenixhou;2089976
我的Dolphin和Konqueror是4.3.5,为什么还是有这个问题呢?
请问应如何解决。谢谢。

你这些中文文件名,是现在建立的,还是以前建立的?
你测试一下,在konsole下建立一个中文文件名字,看看在dolphin下是不是乱码?
locale输出什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-14 14:23:15 | 显示全部楼层
Post by blackwhite;2089982
你这些中文文件名,是现在建立的,还是以前建立的?
你测试一下,在konsole下建立一个中文文件名字,看看在dolphin下是不是乱码?
locale输出什么?

我试了一下,不管是原来的还是现在新建的都是一样。在Konsole下总是正常显示,在Dolphin下面总是乱码。

locale输出在上面的原帖里。
回复 支持 反对

使用道具 举报

发表于 2010-5-14 23:23:56 | 显示全部楼层
Post by phoenixhou;2090008
我试了一下,不管是原来的还是现在新建的都是一样。在Konsole下总是正常显示,在Dolphin下面总是乱码。

locale输出在上面的原帖里。

你konsole终端编码用的是什么?
菜单->view->Character Encoding->Unicode->UTF-8
locale -a输出什么?/etc/locale.gen里边支持什么编码?
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GB18030
zh_CN.GB2312 GB2312
zh_CN.UTF-8 UTF-8
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-15 10:35:46 | 显示全部楼层
Post by blackwhite;2090147
你konsole终端编码用的是什么?
菜单->view->Character Encoding->Unicode->UTF-8
locale -a输出什么?/etc/locale.gen里边支持什么编码?

Konsole终端的编码是UTF-8
  1. $ locale -a
  2. C
  3. en_US.utf8
  4. ja_JP
  5. ja_JP.eucjp
  6. ja_JP.ujis
  7. ja_JP.utf8
  8. japanese
  9. japanese.euc
  10. POSIX
  11. zh_CN
  12. zh_CN.gb18030
  13. zh_CN.gb2312
  14. zh_CN.gbk
  15. zh_CN.utf8
  16. zh_TW.utf8
复制代码
  1. $ cat /etc/locale.gen
  2. # /etc/locale.gen: list all of the locales you want to have on your system
  3. #
  4. # The format of each line:
  5. # <locale> <charmap>
  6. #
  7. # Where <locale> is a locale located in /usr/share/i18n/locales/ and
  8. # where <charmap> is a charmap located in /usr/share/i18n/charmaps/.
  9. #
  10. # All blank lines and lines starting with # are ignored.
  11. #
  12. # For the default list of supported combinations, see the file:
  13. # /usr/share/i18n/SUPPORTED
  14. #
  15. # Whenever glibc is emerged, the locales listed here will be automatically
  16. # rebuilt for you.  After updating this file, you can simply run `locale-gen`
  17. # yourself instead of re-emerging glibc.
  18. #en_US ISO-8859-1
  19. en_US.UTF-8 UTF-8
  20. zh_CN.UTF-8 UTF-8
  21. zh_CN.GBK GBK
  22. zh_CN.GB18030 GB18030
  23. zh_CN GB2312
  24. zh_TW.UTF-8 UTF-8
  25. ja_JP.EUC-JP EUC-JP
  26. ja_JP.UTF-8 UTF-8
  27. ja_JP EUC-JP
  28. #en_HK ISO-8859-1
  29. #en_PH ISO-8859-1
  30. #de_DE ISO-8859-1
  31. #de_DE@euro ISO-8859-15
  32. #es_MX ISO-8859-1
  33. #fa_IR UTF-8
  34. #fr_FR ISO-8859-1
  35. #fr_FR@euro ISO-8859-15
  36. #it_IT ISO-8859-1
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-5-16 18:48:23 | 显示全部楼层
解决了。

问题好像出在我没有设定全局locale。/etc/env.d/02locale这个文件不知为何不存在,而是在.bashrc里面设定的LANG。
在/etc/env.d/02locale里设定LANG="zh_CN.UTF-8"之后,进入KDE之后X假死,原因不明。
设定为LANG="en_US.UTF-8"后正常,文件名正常显示。
回复 支持 反对

使用道具 举报

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

本版积分规则

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