|
楼主 |
发表于 2006-12-6 20:56:48
|
显示全部楼层
多谢,确实是用utf-8的locale则没这个问题,我的locale是:
LANG=zh_CN.GBK
LANGUAGE=zh_CN:zh
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=zh_CN.GBK
还不想换utf8。
这是启动的时候出现的警告信息:
[FVWM][convert_charsets]: WARNING -
Invalid byte sequence during conversion from GBK to UTF-8
[FVWM][convert_charsets]: WARNING -
Invalid byte sequence during conversion from GBK to UTF-8
搜索得知:http://www.fvwm.org/cgi-bin/fvwm ... 4;page=9;user=guest
http://www.fvwm.org/cgi-bin/fvwm ... 7;page=7;user=guest
Date: Sat, 5 Mar 2005 00:08:08 -0600
From: luojie@nlsde.buaa.edu.cn
To: fvwm-bug@fvwm.org
Subject: FVWM's Default Charset
Full_Name: LuoJie
Version: 2.5.12
CVS_Date:
OS: Gentoo 2004.3
X_Server: Xorg 6.8.0
Submission from: (NULL) (61.233.144.194)
For some reason, I have to set my locale' LC_CTYPE to zh_CN.UTF-8. When I
start fvwm in that locale, fvwm give me a warning
"[FVWM][convert_charsets]: WARNING -
Invalid byte sequence during conversion from UTF-8 to ISO-8859-1"
I use fvwm's PrintInfo command "rintInfo Locale 1" and get the following
message.
locale: zh_CN.UTF-8, Modifier:
Default Charset: X: ISO8859-1, Iconv: ISO-8859-1, Bidi: No
XOM Charsets: ISO8859-1 ISO8859-1 GB2312.1980-0 GBK-0 JISX0208.1983-0
KSC5601.1987-0 JISX0201.1976-0 ISO10646-1
Number of loaded font: 3
* Font number 0
fvwm info:
Name: Shadow=1 SE:xft:Vera Sans
YuanTi:Bold:size=10:encoding=iso10646-1
Cache count: 2
Type: XftFont
Charset: X: ISO10646-1, Iconv: UTF-8, Bidi: No
height: 19, ascent: 13, descent: 5
shadow size: 1, shadow offset: 0, shadow direction:32
* Font number 1
fvwm info:
Name: Shadow=1 1 SE:xft:Vera Sans
YuanTi:Bold:size=10:encoding=iso10646-1
Cache count: 1
Type: XftFont
Charset: X: ISO10646-1, Iconv: UTF-8, Bidi: No
height: 20, ascent: 13, descent: 6
shadow size: 1, shadow offset: 1, shadow direction:32
* Font number 2
fvwm info:
Name: xft:Vera Sans YuanTi:Bold:size=9:encoding=iso10646-1
Cache count: 1
Type: XftFont
Charset: X: ISO10646-1, Iconv: UTF-8, Bidi: No
height: 16, ascent: 12, descent: 3
shadow size: 0, shadow offset: 0, shadow direction:0
So I find the Default Charset is wrong, it should be ISO10646-1. And the
Iconv should be UTF-8. I read the source code, and find the Default Charset
is set to FLCXOMCharset and in libs/FlocaleCharset.c at line 524 in
function FlocaleInit_X_Charset, I find this
FLCXOMCharset = FLCXOMCharsetList[0]
For zh_CN.UTF-8 locale FLCXOMCharsetList[0] is ISO8859-1,
FLCXOMCharsetList[FLCXOMCharset_num - 1] is ISO10646-1. So we can't set to
FLCXOMCharset to FLCXOMCharsetList[0], we should set it to
FLCXOMCharsetList[FLCXOMCharset_num - 1].
I just change FLCXOMCharset to FLCXOMCharsetList[FLCXOMCharset_num - 1] and
recompile, it work for my zh_CN.UTF-8 locale now.
So I think we can't simply set FLCXOMCharset to FLCXOMCharsetList[0], for
some locale it should set to other value. |
|