Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Jan 2000 00:33:01 +0200 (EET)
From:      jau@cs74137.pp.htv.fi (Jukka Ukkonen)
To:        questions@freebsd.org
Subject:   Extremely odd catopen() behaviour...
Message-ID:  <200001302233.AAA49383@mjolnir.thunderbolt.fi>

next in thread | raw e-mail | index | archive | help

	Hello all!

	I have been wondering whether there is any good reason why the
	message catalogs do not obey LC_ALL when there is no LANG or
	LC_MESSAGES set.
	Shouldn't LC_ALL be a catch all variable that sets a default
	for any category which is not explicitly set using the one of
	other LC_* variables?

	On the other hand it seems rather odd to me to make catopen()
	actually depend on the NL_CAT_LOCALE flag and exclude one or
	the other of LC_MESSAGES or LANG completely. As far as I know
	these variables were never intended to serve the same purpose,
	but LANG served as a sort of "catch all" when the LC_* variables
	did not exist yet.

	From my point of view the OSF/1 interpretation was entirely
	correct, because they decided that the logic should be roughly
	this...

	    locale = getenv ("LC_MESSAGES");	/* or any other LC_* */
	
	    if (locale)
	        goto Locale_OK;
	
	    locale = getenv ("LANG");
	
	    if (locale)
	        goto Locale_OK;
	
	    locale = getenv ("LC_ALL");
	
	    if (! locale)
	        locale = "C";
	
	Locale_OK:
	    .
	    .
	    .

	I see no problem with this interpretation. There would be two
	sort of "catch all" environment variables, but that would only
	be very nice backward compatibility.
	In my opinion it is quite enough compatibility with XPG4 to
	have NL_CAT_LOCALE defined as 0 in the header file as it is
	in my implementation.

	In fact my own implementation of the message catalogs has been
	made using libdb in b-tree mode, and based on that experiment
	there is much better use for the flags argument serving as the
	mode & flags for the DB file. ;-)


	Cheers,
		// jau
.---  ..-  -.-  -.-  .-    .-  .-.-.-    ..-  -.-  -.-  ---  -.  .  -.
  /    Jukka A. Ukkonen,                          SysOpen Plc, Finland
 /__   M.Sc. (sw-eng & cs)                   (Phone) +358-424-2020-331
   /   Internet: Jukka.Ukkonen@SysOpen.Fi      (Fax) +358-424-2020-700
  /    Internet: ukkonen@nic.funet.fi       (Mobile) +358-400-606-671
 v     Internet: jau@iki.fi               (Home&Fax) +358-9-6215-280


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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