1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
.\" $OpenBSD: nl_langinfo.3,v 1.13 2017/10/04 17:59:24 schwarze Exp $
.\"
.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: October 4 2017 $
.Dt NL_LANGINFO 3
.Os
.Sh NAME
.Nm nl_langinfo ,
.Nm nl_langinfo_l
.Nd get locale information
.Sh SYNOPSIS
.In langinfo.h
.Ft char *
.Fn nl_langinfo "nl_item item"
.Ft char *
.Fn nl_langinfo_l "nl_item item" "locale_t locale"
.Sh DESCRIPTION
The
.Fn nl_langinfo
function returns information about the global
.Xr locale 1 ,
and
.Fn nl_langinfo_l
about the
.Fa locale
passed as an argument.
.Sh RETURN VALUES
On
.Ox ,
if
.Fa item
is
.Dv CODESET ,
the return value is either
.Qq US-ASCII
or
.Qq UTF-8 .
For other values of
.Fa item ,
the strings that
.St -p1003.1-2008
specifies for the C locale are returned.
.Pp
If
.Fa item
is invalid, a pointer to an empty string is returned.
.Sh SEE ALSO
.Xr setlocale 3 ,
.Xr uselocale 3
.Sh STANDARDS
These functions conform to
.St -p1003.1-2008 .
.Sh HISTORY
The function
.Fn nl_langinfo
has been available since
.Nx 1.0 ,
and
.Fn nl_langinfo_l
since
.Ox 6.2 .
.Sh BUGS
The return values for
.Dv CODESET
are not standardized and vary among implementations.
|