Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Oct 1995 11:35:22 +0300 (MSK)
From:      =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (aka Andrey A. Chernov, Black Mage) <ache@astral.msk.su>
To:        Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
Cc:        current@FreeBSD.ORG
Subject:   Re: I plan to change ENABLE_STARTUP_LOCALE behaviour...
Message-ID:  <PkAbXWmuz7@ache.dialup.demos.ru>
In-Reply-To: <199510160807.JAA24523@uriah.heep.sax.de>; from J Wunsch at Mon, 16 Oct 1995 09:07:41 %2B0100 (MET)
References:  <199510160807.JAA24523@uriah.heep.sax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <199510160807.JAA24523@uriah.heep.sax.de> J Wunsch writes:

>As =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= wrote:
>> 
>> I plan to make ENABLE_STARTUP_LOCALE as *default* case
>> and introduce new variable DISABLE_STARTUP_LOCALE
>> to disable thins thing (for debugging purposes f.e.).

>I'm against it.  You wrote:

>3) It is useful only for <=8bit locales, so you can't call setlocale,
>multichars becomes damaged, you need to call reduced to 8bit
>setlocale version as done in crt0.
>4) Using non-standard (non-POSIX/ANSI/etc) reduced setlocale in
>all sources cause portability problems.

>So either this is broken, and we cannot make it the default, or we
>should really put a ``setlocale(LC_CTYPE, "");'' on top of all system
>utilities that use <ctype.h> functions.  This is effectively the same
>as your crt0.o hack, but then it's obvious that it's part of the
>program.

>Right now, part of the utilities does the right thing (e.g. "vi"), and
>most others don't.

Really, I don't understand, how 3) and 4) related anyhow to my proposal.

'Broken' is result of your intention to put 'setlocale' call
to all main()s. It is broken because of 3). If you change it
to call used in crt0, it will be broken because of 4).

In my case:
1) I don't put anything non-standard into main(). (crt0 already
full of non-standard things).
2) I do right thing when LANG not set or set to "C" (ASCII per POSIX).
3) I do right thing for >8bit charsets (ASCII per POSIX).
4) I do right thing for pgms wich calls setlocale by itself like vi.
5) It is more easy to users and don't involve explanation each time.
(I am already tired to say "setenv ENABLE_STARTUP_LOCALE" on
each "fix" comes to -hackers list).

-- 
Andrey A. Chernov        : And I rest so composedly,  /Now, in my bed,
ache@astral.msk.su       : That any beholder  /Might fancy me dead -
FidoNet: 2:5020/230.3    : Might start at beholding me,  /Thinking me dead.
RELCOM Team,FreeBSD Team :         E.A.Poe         From "For Annie" 1849



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?PkAbXWmuz7>