summaryrefslogtreecommitdiffstats
path: root/man3/setlocale.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--man3/setlocale.337
1 files changed, 18 insertions, 19 deletions
diff --git a/man3/setlocale.3 b/man3/setlocale.3
index d2b511e..50a36d8 100644
--- a/man3/setlocale.3
+++ b/man3/setlocale.3
@@ -10,7 +10,7 @@
.\" Modified Tue Aug 24 17:11:01 1999 by Andries Brouwer (aeb@cwi.nl)
.\" Modified Tue Feb 6 03:31:55 2001 by Andries Brouwer (aeb@cwi.nl)
.\"
-.TH setlocale 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH setlocale 3 2024-02-25 "Linux man-pages 6.7"
.SH NAME
setlocale \- set the current locale
.SH LIBRARY
@@ -19,14 +19,14 @@ Standard C library
.SH SYNOPSIS
.nf
.B #include <locale.h>
-.PP
+.P
.BI "char *setlocale(int " category ", const char *" locale );
.fi
.SH DESCRIPTION
The
.BR setlocale ()
function is used to set or query the program's current locale.
-.PP
+.P
If
.I locale
is not NULL,
@@ -74,12 +74,12 @@ LC_TIME T{
Formatting of date and time values
T}
.TE
-.PP
+.P
The categories marked with an asterisk in the above table
are GNU extensions.
For further information on these locale categories, see
.BR locale (7).
-.PP
+.P
The argument
.I locale
is a pointer to a character string containing the
@@ -88,11 +88,11 @@ required setting of
Such a string is either a well-known constant like "C" or "da_DK"
(see below), or an opaque string that was returned by another call of
.BR setlocale ().
-.PP
+.P
If
.I locale
is an empty string,
-.BR """""" ,
+.BR \[dq]\[dq] ,
each part of the locale that should be modified is set according to the
environment variables.
The details are implementation-dependent.
@@ -110,21 +110,21 @@ If its value is not a valid locale specification, the locale
is unchanged, and
.BR setlocale ()
returns NULL.
-.PP
+.P
The locale
-.B """C"""
+.B \[dq]C\[dq]
or
-.B """POSIX"""
+.B \[dq]POSIX\[dq]
is a portable locale;
it exists on all conforming systems.
-.PP
+.P
A locale name is typically of the form
.IR language "[_" territory "][." codeset "][@" modifier "],"
where
.I language
-is an ISO 639 language code,
+is an ISO\~639 language code,
.I territory
-is an ISO 3166 country code, and
+is an ISO\~3166 country code, and
.I codeset
is a character set or encoding identifier like
.B "ISO\-8859\-1"
@@ -132,22 +132,22 @@ or
.BR "UTF\-8" .
For a list of all supported locales, try "locale \-a" (see
.BR locale (1)).
-.PP
+.P
If
.I locale
is NULL, the current locale is only queried, not modified.
-.PP
+.P
On startup of the main program, the portable
-.B """C"""
+.B \[dq]C\[dq]
locale is selected as default.
A program may be made portable to all locales by calling:
-.PP
+.P
.in +4n
.EX
setlocale(LC_ALL, "");
.EE
.in
-.PP
+.P
after program initialization, and then:
.IP \[bu] 3
using the values returned from a
@@ -191,7 +191,6 @@ T{
.BR setlocale ()
T} Thread safety MT-Unsafe const:locale env
.TE
-.sp 1
.SH STANDARDS
C11, POSIX.1-2008.
.SS Categories