From owner-freebsd-questions Wed May 6 21:17:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA04266 for freebsd-questions-outgoing; Wed, 6 May 1998 21:17:57 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from tera.com (tera.tera.com [207.108.223.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA04242 for ; Wed, 6 May 1998 21:17:50 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from uucp@localhost) by tera.com (8.8.7/8.7.3) with UUCP id VAA12993 for freebsd-questions@FreeBSD.ORG; Wed, 6 May 1998 21:17:10 -0700 (PDT) Received: (from kline@localhost) by tao.thought.org (8.8.5/8.7.3) id VAA23567 for freebsd-questions@FreeBSD.ORG; Wed, 6 May 1998 21:11:10 -0700 (PDT) From: Gary Kline Message-Id: <199805070411.VAA23567@tao.thought.org> Subject: further locale questions... To: freebsd-questions@FreeBSD.ORG (FreeBSD Mailing List) Date: Wed, 6 May 1998 21:11:10 -0700 (PDT) Organization: <> thought.org: public access uNix in service... <> X-Mailer: ELM [version 2.4ME+ PL32 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Several days ago I asked if anyone could clue me in on how our locale library worked. Most of my code did nothing. Something like this (and thanks to Geoff Keating): #include #include #include int main(void) { time_t now; char buf[1000]; struct tm brokendown; setlocale(LC_ALL, ""); time(&now); brokendown = *localtime(&now); strftime(buf, sizeof(buf), "%c", &brokendown); printf("%s\n", buf); return 0; } should do the following: % env LANG=fr ./now jeu 7 mai 98, 12:37:20 EST % env LANG=en_AU ./now Thu 07 May 1998 12:38:04 PM EST % env LANG=C ./now Thu May 07 12:38:16 1998 But the 2.2.5 libc/locale libraries fail here. If -hackers is a more appropriate place for this, please clue me in. At any rate, does anyone here know what going on? Also, do we//should we have `localedef' and `locale' utilities? From initial hacking it looks as though strftime.c is not making the LC_TIME data available to the environment. FWIW, FreeBSD seems to be ahead of the Net folks here. Clues anybody??? gary -- Gary D. Kline kline@tao.thought.org Public service uNix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message