Re: Bug#160282: cal: Should use the latter Chinese char for day of the week (fwd)
请问有人知道 FreeBSD 的 locale data 是谁维护的吗 ?
( maybe also IBM ICU shound be taken into consideration )
PS. 我是赞成修改 glibc 的 LC_TIME 的 abday 啦 :p
---------- Forwarded message ----------
Date: Tue, 17 Sep 2002 11:03:15 +0800 (CST)
From: lloyd <lloyd@coventive.com>
To: debian-chinese-big5@lists.debian.org
Subject: Re: Bug#160282: cal: Should use the latter Chinese char for day of
the week
Resent-Date: Mon, 16 Sep 2002 22:03:24 -0500 (CDT)
Resent-From: debian-chinese-big5@lists.debian.org
我是不知道为什么 debian 使用的是 bsdutils ..
但总是会有 debian 采用的理由.
我认为 cal 问题出在 strftime 也就是 LC_CTIME 的回傅值。
这一段程式在 linux 与 freebsd 上有不同的表现。
#include <time.h>
#include <locale.h>
int main ()
{
int i,len;
struct tm tm;
char buf[20];
setlocale(LC_ALL,"");
memset(&tm, 0, sizeof(tm));
for (i = 0; i != 7; i++)
{
tm.tm_wday = (i+1) % 7;
strftime(buf, sizeof(buf), "%a", &tm);
len = mbstowcs(NULL, buf, 0);
printf ("%s %d\n",buf,len);
}
for (i = 0; i != 7; i++)
{
tm.tm_wday = (i+1) % 7;
strftime(buf, sizeof(buf), "%A", &tm);
len = mbstowcs(NULL, buf, 0);
printf ("%s %d\n",buf,len);
}
}
debian woody freebsd 4.6
周一 2 一 -1
周二 2 二 -1
周三 2 三 -1
周四 2 四 -1
周五 2 五 -1
周六 2 六 -1
周日 2 日 -1
星期一 3 周一 -1
星期二 3 周二 -1
星期三 3 周三 -1
星期四 3 周四 -1
星期五 3 周五 -1
星期六 3 周六 -1
星期日 3 周日 -1
debian 的 ncal 来自 bsd ,
bsd 的是
9月 2002
日 一 二 三 四 五 六
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
而 linux 最多最多也只能改成
九月 2002
周日 周一 周二 周三 周四 周五 周六
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
因为我们不知道这是否会引响到别的同是双位元语系国家, 除非是去修正我们自己的 LC_CTIME
让它的 strftime(buf, sizeof(buf), "%a", &tm); 为
日 一 二 三 四 五 六
而 strftime(buf, sizeof(buf), "%A", &tm); 为
周日 周一 周二 周三 周四 周五 周六
但这样作下去又一定会去引响到其它程式
所以最好加上一段 sed 程式, 将 周 这个字滤掉.
有这方面须求的人可以取回 util-linux
http://www.kernel.org/pub/linux/utils/util-linux/ 改用 util-linux 的 cal
或是采用 加上 Rex Tsai 帮忙的 Patch 来修正这个问题。
为了画面的美观加一段 sed 程式 取名为 zh-cal 放到 /usr/local/bin 下
#!/bin/bash
cal %@ | sed 's/周//d'
--
□□
□□□ □□ □□□□
□ □□□ 造形.空间.秩序.□□ □□□□ 主从.对比.韵律□□ □□□□□□ lloyd@coventive.com □
□□□□□□□□□□□□□□ Coventive Technologies Ltd □
--
To UNSUBSCRIBE, email to debian-chinese-big5-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
--
To UNSUBSCRIBE, email to debian-chinese-big5-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
--
| This message was re-posted from debian-chinese-big5@lists.debian.org
| and converted from big5 to gb2312 by an automatic gateway.
Reply to: