Bug 41824 - [patch] LANG is not documented in setlocale(3)
Summary: [patch] LANG is not documented in setlocale(3)
Status: Open
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2002-08-20 21:00 UTC by Slaven Rezic
Modified: 2020-08-14 07:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Slaven Rezic 2002-08-20 21:00:03 UTC
	The LANG environment variable is not described in the
	setlocale(3) manpage. It would also be helpful to describe the
	priority of the environment variables (AFAIK: LC_ALL, then
	LC_*, then LANG).
Comment 1 Murray Stokely freebsd_committer 2003-05-04 14:34:59 UTC
Responsible Changed
From-To: freebsd-doc->murray

I will take a look at this one.
Comment 2 conall=freebsd 2006-06-10 02:49:37 UTC
A patch to describe the LANG variable and note that
documented order (LC_ALL, LC_*, LANG) is the priority order (or so I'm
led to believe from the initial log of this PR)


--- setlocale.3.orig    Sat Jun 10 02:37:30 2006
+++ setlocale.3 Sat Jun 10 02:48:42 2006
@@ -60,7 +60,8 @@
 The
 .Fn setlocale
 function recognizes several categories of routines.
-These are the categories and the sets of routines they select:
+In decending order of evaluation priority, the categories and the sets 
+of routines they select:
 .Pp
 .Bl -tag -width LC_MONETARY
 .It Dv LC_ALL
@@ -103,6 +104,9 @@
 Set a locale for formatting dates and times using the
 .Fn strftime
 function.
+.It Dv LANG
+Sets the generic locale category for native language, local customs and 
+coded character set in the absence of any configured LC_* variables.
 .El
 .Pp
 Only three locales are defined by default,

-- 

Regards,

Conall O'Brien

Systems and Network Administrator
School Of Mathematics
University Of Dublin, Trinity College
Comment 3 murray.stokely 2008-12-14 23:06:27 UTC
There is also an EXAMPLES section in the NetBSD man page we may want to borrow :

http://people.freebsd.org/~murray/patches/setlocale.3.diff

          - Murray
Comment 4 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:01:19 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 5 commit-hook freebsd_committer 2020-08-07 17:26:05 UTC
A commit references this bug:

Author: gbe
Date: Fri Aug  7 17:25:56 UTC 2020
New revision: 364032
URL: https://svnweb.freebsd.org/changeset/base/364032

Log:
  setlocale(3): Add an EXAMPLES section and add LANG category

  PR:		41824
  Submitted by:	Slaven Rezic <eserte atvran dot herceg dot de>
  Obtained from:	NetBSD
  MFC after:	1 week

Changes:
  head/lib/libc/locale/setlocale.3
Comment 6 commit-hook freebsd_committer 2020-08-14 06:46:47 UTC
A commit references this bug:

Author: gbe
Date: Fri Aug 14 06:46:40 UTC 2020
New revision: 364230
URL: https://svnweb.freebsd.org/changeset/base/364230

Log:
  MFC r364032: setlocale(3): Add an EXAMPLES section and add LANG category

  PR:		41824
  Submitted by:	Slaven Rezic <eserte at vran dot herceg dot de>
  Obtained from:	NetBSD

Changes:
_U  stable/12/
  stable/12/lib/libc/locale/setlocale.3
Comment 7 moridin 2020-08-14 07:25:51 UTC
Both example setlocale() calls would fail as there's no "de" or "fr" locale directory under /usr/share/locale and it might confuse users; it would help to provide examples that work as is, preferably using UTF-8 locales, i.e. de_DE.UTF-8 and fr_FR.UTF-8.