From owner-freebsd-hackers Mon Oct 16 18:37:49 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id SAA02895 for hackers-outgoing; Mon, 16 Oct 1995 18:37:49 -0700 Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id SAA02890 for ; Mon, 16 Oct 1995 18:37:46 -0700 Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id SAA26056; Mon, 16 Oct 1995 18:32:36 -0700 From: Terry Lambert Message-Id: <199510170132.SAA26056@phaeton.artisoft.com> Subject: Re: A couple problems in FreeBSD 2.1.0-950922-SNAP To: ache@astral.msk.su (=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=) Date: Mon, 16 Oct 1995 18:32:36 -0700 (MST) Cc: terry@lambert.org, bde@zeta.org.au, hackers@freefall.freebsd.org, j@uriah.heep.sax.de, kaleb@x.org, phk@critter.tfs.com In-Reply-To: from "=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?=" at Oct 17, 95 02:57:56 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 2311 Sender: owner-hackers@FreeBSD.org Precedence: bulk > Now you vote for solution which is simple subcase of my crt0 hack: > > setlocale(LC_ALL, ""); /* my */ > > changed to > > setlocale(LC_ALL, "lt_LN.ISO_8859-1"); /* your */ > > Since your variant is static (and my is adjusted to current LANG), > you don't need even such call and can patch default table directly. The difference is, I'm not making a call. Any you can "patch" a binary by looking for the locale specific table's symbols in the binary and modifying them. Or you can patch the source and make the code locale aware. Like you should be doing in the first place. > For LANG = 8859-1 both variants are equal, but for LANG != 8859-1 you > give some strange values calling them 'default' and I give > full correct ctype/time/collate table. If we take the American-specific ASCII C locale per POSIX as opposed to the 8859-1 specific ISO C locale, we simply increase the "incorrect" behaviour. The point of using the POSIX C locale as default is to inconvenience people, nagging them into makeing their code locale aware. Technically, ISO C locale permits removal of the nagging for ISO8859-1, as well as 7 bit ASCII, which is understandable because of who are and aren't ISO member standards bodies (US, Western European, etc.) But this does not invalidate the reasons for nagging in the first place. And Western European nations (other than English speakers that can get by with ASCII) don't get their preferred collation sequence either. Just like you. Germany has two sequences (dictionary and telephone directory order), neither of which are satisfied by a halfway job of internationalization. I think you would be hard put to find a program that did strcmp() for sorting in any case, so it's likely that anything that was collation sequence sensitive under your hack, would in fact have been written to call setlocale() specifically in the first place. The point is to stay within the bounds of the standards. We have both precedent and standards recognition for 8859-1 in the C locale. Yes, this means that code that has not been internationalized will annoy you until you fix it. With due respect, this is a *feature*. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.