.\" $OpenBSD: nl_langinfo.3,v 1.13 2017/10/04 17:59:24 schwarze Exp $ .\" .\" Copyright (c) 2017 Ingo Schwarze .\" .\" 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.