nl_langinfo(3int)nl_langinfo(3int)Name
nl_langinfo - language information
Syntax
#include <nl_types.h>
#include <langinfo.h>
char *nl_langinfo (item)
nl_item item;
Description
The function returns a pointer to a null-terminated string containing information relevant to a particular language or cultural area. The
language is identified by the last successful call to the appropriate category. The categories are shown in the following table and are
defined in
For instance, the following example would return a pointer to the string representing the abbreviated name for the first day of the week,
as defined by category
nl_langinfo (ABDAY_1);
If the category has not been called successfully, data for a supported language is not available, or is not defined, then returns a pointer
to an empty (null) string. In the C locale, the return value is the American English string defined in the following table:
-----------------------------------------------------------------------
Identifier Meaning C locale Category
-----------------------------------------------------------------------
NOSTR Negative response no LC_ALL
YESSTR Positive response yes LC_ALL
D_T_FMT Default date and time format %a %b %d
%H:%M:%S %Y LC_TIME
D_FMT Default date format %m/%d/%y LC_TIME
T_FMT Default time format %h:%m:%s LC_TIME
DAY_1 Day name Sunday LC_TIME
DAY_2 Day name Monday LC_TIME
.... .... .... ....
DAY_7 Day name Saturday LC_TIME
ABDAY_1 Abbreviated day name Sun LC_TIME
ABDAY_2 Abbreviated day name Mon LC_TIME
ABDAY_3 Abbreviated day name Tue LC_TIME
.... .... .... ....
ABDAY_7 Abbreviated day name Sat LC_TIME
MON_1 Month name January LC_TIME
MON_2 Month name February LC_TIME
MON_3 Month name March LC_TIME
.... .... .... ....
MON_12 Month name December LC_TIME
ABMON_1 Abbreviated month name Jan LC_TIME
ABMON_2 Abbreviated month name Feb LC_TIME
.... .... .... ....
ABMON_12 Abbreviated month name Dec LC_TIME
RADIXCHAR Radix character . LC_NUMERIC
THOUSEP Thousands separator LC_NUMERIC
CRNCYSTR Currency format LC_MONETARY
AM_STR String for AM AM LC_TIME
PM_STR String for PM PM LC_TIME
EXPL_STR Lower case exponent character e LC_NUMERIC
EXPU_STR Upper case exponent character E LC_NUMERIC
-----------------------------------------------------------------------
See Alsointro(3int), ic(1int), setlocale(3int), environ(5int), nl_types(5int)
Guide to Developing International Software
nl_langinfo(3int)
Check Out this Related Man Page
langinfo.h(3HEAD) Headers langinfo.h(3HEAD)NAME
langinfo.h, langinfo - language information constants
SYNOPSIS
#include <langinfo.h>
DESCRIPTION
The <langinfo.h> header contains the constants used to identify items of langinfo data (see nl_langinfo(3C)). The type of the constant,
nl_item, is defined as described in <nl_types.h>.
The following constants are defined. The entries under Category indicate in which setlocale(3C) category each item is defined.
Constant Category Meaning
CODESET LC_CTYPE codeset name
D_T_FMT LC_TIME string for formatting date and time
D_FMT LC_TIME date format string
T_FMT LC_TIME time format string
T_FMT_AMPM LC_TIME a.m. or p.m. time format string
AM_STR LC_TIME ante-meridiem affix
PM_STR LC_TIME post-meridiem affix
DAY_1 LC_TIME name of the first day of the week
(for example, Sunday)
DAY_2 LC_TIME name of the second day of the week
(for example, Monday)
DAY_3 LC_TIME name of the third day of the week
(for example, Tuesday)
DAY_4 LC_TIME name of the fourth day of the week
(for example, Wednesday)
DAY_5 LC_TIME name of the fifth day of the week
(for example, Thursday)
DAY_6 LC_TIME name of the sixth day of the week
(for example, Friday)
DAY_7 LC_TIME name of the seventh day of the week
(for example, Saturday)
ABDAY_1 LC_TIME abbreviated name of the first day
of the week
ABDAY_2 LC_TIME abbreviated name of the second day
of the week
ABDAY_3 LC_TIME abbreviated name of the third day
of the week
ABDAY_4 LC_TIME abbreviated name of the fourth day
of the week
ABDAY_5 LC_TIME abbreviated name of the fifth day
of the week
ABDAY_6 LC_TIME abbreviated name of the seventh day
of the week
ABDAY_7 LC_TIME abbreviated name of the seventh day
of the week
MON_1 LC_TIME name of the first month of the year
MON_2 LC_TIME name of the second month
MON_3 LC_TIME name of the third month
MON_4 LC_TIME name of the fourth month
MON_5 LC_TIME name of the fifth month
MON_6 LC_TIME name of the sixth month
MON_7 LC_TIME name of the seventh month
MON_8 LC_TIME name of the eighth month
MON_9 LC_TIME name of the ninth month
MON_10 LC_TIME name of the tenth month
MON_11 LC_TIME name of the eleventh month
MON_12 LC_TIME name of the twelfth month
ABMON_1 LC_TIME abbreviated name of the first month
ABMON_2 LC_TIME abbreviated name of the second
month
ABMON_3 LC_TIME abbreviated name of the third month
ABMON_4 LC_TIME abbreviated name of the fourth
month
ABMON_5 LC_TIME abbreviated name of the fifth month
ABMON_6 LC_TIME abbreviated name of the sixth month
ABMON_7 LC_TIME abbreviated name of the seventh
month
ABMON_8 LC_TIME abbreviated name of the eighth
month
ABMON_9 LC_TIME abbreviated name of the ninth month
ABMON_10 LC_TIME abbreviated name of the tenth month
ABMON_11 LC_TIME abbreviated name of the eleventh
month
ABMON_12 LC_TIME abbreviated name of the twelfth
month
ERA LC_TIME era description segments
ERA_D_FMT LC_TIME era date format string
ERA_D_T_FMT LC_TIME era date and time format string
ERA_T_FMT LC_TIME era time format string
ALT_DIGITS LC_TIME alternative symbols for digits
RADIXCHAR LC_NUMERIC radix character
THOUSEP LC_NUMERIC separator for thousands
YESEXPR LC_MESSAGES affirmative response expression
NOEXPR LC_MESSAGES negative response expression
YESSTR LC_MESSAGES affirmative response for yes/no
queries
NOSTR LC_MESSAGES negative response ro yes/no queries
CRNCYSTR LC_MONETARY local currency symbol, preceded by
'-' if the symbol sould appear
before the value, '+' if the symbol
should appear after the value, or
'.' if the symbol should replace
the radix character
If the locale's values for p_cs_precedes and n_cs_precedes do not match, the value of nl_langinfo(CRNCYSTR) is unspecified.
The <langinfo.h> header declares the following as a function:
char *nl_langinfo(nl_item);
Inclusion of <langinfo.h> header may also make visible all symbols from <nl_types.h>.
USAGE
Wherever possible, users are advised to use functions compatible with those in the ISO C standard to access items of langinfo data. In par-
ticular, the strftime(3C) function should be used to access date and time information defined in category LC_TIME. The localeconv(3C) func-
tion should be used to access information corresponding to RADIXCHAR, THOUSEP, and CRNCYSTR.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO mkmsgs(1), localeconv(3C), nl_langinfo(3C), nl_types.h(3HEAD), setlocale(3C), strftime(3C), attributes(5), standards(5)SunOS 5.10 30 Aug 2002 langinfo.h(3HEAD)