Index Index for
Section 3
Index Alphabetical
listing for N
Bottom of page Bottom of
page

nl_langinfo(3)

NAME

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

SYNOPSIS

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

LIBRARY

Standard C Library (libc)

STANDARDS

Interfaces documented on this reference page conform to industry standards as follows: nl_langinfo(): XSH5.0 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. The array pointed to by the return value may contain static data that is overridden on the next call to nl_langinfo(). This array should not be modified by the application, only by further calls to nl_langinfo(). The XSH specification does not require the nl_langinfo() function to be re-entrant.

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.

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.

SEE ALSO

Functions: localeconv(3), setlocale(3), strfmon(3) Others: i18n_intro(5), l10n_intro(5), standards(5) Writing Software for the International Market

Index Index for
Section 3
Index Alphabetical
listing for N
Top of page Top of
page