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