Hello,

I found a little bug in "date" (SH-Utils 2.0). There is an option
"date --rfc-822". In the C/English locale it works fine:

$ LANG=C date --rfc-822
Sun, 20 Aug 2000 21:28:25 +0200
$

The problem occurs, when I use an other locale (for instance German):

$ LANG=de_DE.ISO-8859-1 date --rfc-822
Son, 20 Aug 2000 21:29:40 +0200
$

The problem is better visible in Russian:

$ LANG=ru_RU.KOI8-R date --rfc-822
���, 20 ��� 2000 21:30:45 +0200
$

I think it's not a good solution to set the environment variable LANG
globally to "C" because then we cannot use the localizations/
translations in some programs. Setting LANG to "C" before "date" is
only a workaround.

I have read RFC-822 and found, that these dates are probably wrong
formated, because an RFC 822 conform application cannot know all
language specific versions of month names. 

I found this bug also in Libwww (an WWW API from www.w3.org). 

I haven't checked the source code of "date". But in my programs I also
got such problems if I didn't set a fixed locale (setlocale call). I
don't know if this will cause other problems in "date". So probably
the RFC-822 date should be formed manually. I think the sources of
E-Mail programs are a good source for this.

I think it's important to fix this bug, because

 (1) not every user knows the workaround "LANG=C date --rfc-822"

 (2) the RFC 822 date could be useful for instance in shell scripts
     or other programming languages which implement network protocolls

If you like I will search for an good solution in the next time (end
of September).

Yours sincerely,
Bj�rn Voigt


--
Bj�rn Voigt <[EMAIL PROTECTED]>
Telephone: +49 (30) 6 36 66 27   Fax: +49 (89) 2443-27923
WWW:     http://user.cs.tu-berlin.de/~bjoern/



Reply via email to