Index Click this button to go to the index for this section.


nl_langinfo(3)

NAME

nl_langinfo - Returns language or cultural data defined in the current locale

LIBRARY

Standard C Library (libc.so, libc.a)

SYNOPSIS

#include <langinfo.h> char *nl_langinfo( nl_item item);

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows: nl_langinfo(): XPG4 Refer to the standards(5) reference page for more information about industry standards and associated tags.

PARAMETERS

item Specifies a constant name or value.

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 constant names and values that are valid for the item parameter are defined in the langinfo.h header file.

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 POSIX (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: localeconv(3), setlocale(3), strfmon(3) Others: i18n_intro(5), l10n_intro(5), standards(5) Writing Software for the International Market