LinuxSir.cn,穿越时空的Linuxsir!

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

gentoo+xorg+fvwm+firefox的顽固字体问题

[复制链接]
发表于 2006-2-28 01:33:30 | 显示全部楼层 |阅读模式
没用设定任何的locale,只在~/.xinitrc有几行:
[color="Red"]export LANG=en_US.utf8
export LC_CTYPE=zh_CN.utf8
fvwm
进入X,一旦有中文显示,在退出X后会显示:
[FVWM][convert_charsets]: WARNING -
                 Invalid byte sequence during conversion from UTF-8 to ISO-8859-1
虽然firefox、gvim等程序的中文显示正常,但以上的提示让我很不爽!同样的fvwm配置文件在以前的debian下是没用这样的提示的。
为什么?有什么办法解决?
发表于 2006-2-28 02:13:01 | 显示全部楼层
同问,不过也是一样不影响使用。楼主要是看着不爽就把提示信息都用重定向消灭掉吧。
回复 支持 反对

使用道具 举报

发表于 2006-2-28 22:48:23 | 显示全部楼层
这是Fvwm处理 zh_CN.UTF-8 locale 的编码时的错误,他会将其默认编码设为 iso8859-1,实际上在于它设置编码的程序太简单了没有考虑到这种情况。不过是不是只有这一个 locale 有问题我就不知道了。也有可能是 Xlib 或者其他什么相关的库里面对这一个 locale 的编码设置有问题。反正我是打了一个补丁,在 zh_CN.UTF-8 locale 下特殊处理一下,把编码设成 UTF-8。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-2 00:32:34 | 显示全部楼层
反正我是打了一个补丁,在 zh_CN.UTF-8 locale 下特殊处理一下,把编码设成 UTF-8。

是否之前也与我一样的问题,现在是否已正常了?能说详细点吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-2 01:58:45 | 显示全部楼层
Once a font is loaded, fvwm finds its encoding (or charset) using its name (the last two fields of the name). fvwm assumes that the strings which are displayed with this font use this encoding (an exception is that if an iso10646-1 font is loaded, then UTF-8 is assumed for string encoding). In a normal situation, (i) a font is loaded by giving a font name without specifying the encoding, (ii) the encoding of the loaded font is the locale encoding, and then (iii) the strings in the fvwm configuration files should use the locale encoding as well as the window and icon name. With Xft the situation is bit different as Xft supports only iso10646-1 and iso8859-1. If you do not specify one of these encodings in the Xft font name, then fvwm does strings conversion using (iii). Note that with multibyte fonts (and in particular with "CJK" fonts) for good text rendering, the locale encoding should be the charset of the font.
这个是什么意思?
回复 支持 反对

使用道具 举报

发表于 2006-3-2 09:33:09 | 显示全部楼层
FVWM的字体是怎么设的,我把字体编码都设成了iso10646-1,没碰到过这些问题。
回复 支持 反对

使用道具 举报

发表于 2006-3-2 13:41:20 | 显示全部楼层
打了补丁后可以在zh_CN.UTF-8的locale下用了,没有那个警告,其他的locale仍然是默认设置。这个问题是fvwm在设置locale charset时设置不当的问题,把字体编码都设成了iso10646-1也解决不了,在遇到中文标题时它还是认为显示标题的本地编码是iso8859-1,试图将iso10646-1编码的标题转换成iso8859-1,但实际上显示用的编码就是iso10646-1,由于包含CJK的字符,转换不成功,还是使用iso10646-1编码显示,所以显示没有问题。但是会出现那个警告。
回复 支持 反对

使用道具 举报

发表于 2006-3-2 17:44:56 | 显示全部楼层
可以修改fvwm的代码来解决,看这篇文章
http://my.opera.com/alva/blog/show.dml/161523
回复 支持 反对

使用道具 举报

发表于 2006-3-2 19:29:20 | 显示全部楼层
请问这种改法可以实现中英文用不同字体显示么?就像GTK+的程序可以做到的那样?
回复 支持 反对

使用道具 举报

发表于 2006-3-2 20:35:31 | 显示全部楼层
要使中英文用不同的字体的话就不能用XFT,只能用X的字体。只要把英文字体列在中文字体前面就可以了。
回复 支持 反对

使用道具 举报

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

本版积分规则

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