nl_langinfo(3) — Subroutines
NAME
nl_langinfo − Language information
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <langinfo.h>
char ∗nl_langinfo(
nl_item item);
PARAMETERS
itemSpecifies constant names and values.
DESCRIPTION
The nl_langinfo() function returns a pointer to a string containing information relevant to the particular language or cultural area defined in the program’s locale. The structures, constant names, and values of the item parameter are defined in the langinfo.h header file.
NOTES
AES Support Level:
Trial use.
EXAMPLES
The following example returns a pointer to the abbreviated name of the first day of the week in the current locale:
nl_langinfo(ABDAY_1)
This function call would return a pointer to the string "Dom" if the identified language was Portuguese, "Sun" if the identified language was English, and so on.
RETURN VALUES
In a locale where langinfo data is not defined, the nl_langinfo() function returns a pointer to the corresponding string in the C locale. In all locales, the nl_langinfo() function returns a pointer to an empty string if the item parameter contains an invalid setting.
RELATED INFORMATION
Functions: setlocale(3).