GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NL_LANGINFO(3) FreeBSD Library Functions Manual NL_LANGINFO(3)

nl_langinfo
language information

Standard C Library (libc, -lc)

#include <langinfo.h>

char *
nl_langinfo(nl_item item);

char *
nl_langinfo_l(nl_item item, locale_t loc);

The nl_langinfo() function returns a pointer to a string containing information relevant to the particular language or cultural area defined in the program or thread's locale, or in the case of nl_langinfo_l(), the locale passed as the second argument.

Calls to setlocale() with a category corresponding to the category of item, or to the category LC_ALL, may overwrite the buffer pointed to by the return value.

The manifest constant names and values of item are defined in <langinfo.h>.

The following standard constants are recognized:

Constant Category Description
codeset name
string for formatting date and time
date format string
time format string
a.m. or p.m. time format string
ante-meridiem affix
post-meridiem affix
name of the first day of the week
name of the second day of the week
name of the third day of the week
name of the fourth day of the week
name of the fifth day of the week
name of the sixth day of the week
name of the seventh day of the week
abbreviated name of the first day of the week
abbreviated name of the second day of the week
abbreviated name of the third day of the week
abbreviated name of the fourth day of the week
abbreviated name of the fifth day of the week
abbreviated name of the sixth day of the week
abbreviated name of the seventh day of the week
name of the first month of the year
name of the second month
name of the third month
name of the fourth month
name of the fifth month
name of the sixth month
name of the seventh month
name of the eighth month
name of the ninth month
name of the tenth month
name of the eleventh month
name of the twelfth month
abbreviated name of the first month
abbreviated name of the second month
abbreviated name of the third month
abbreviated name of the fourth month
abbreviated name of the fifth month
abbreviated name of the sixth month
abbreviated name of the seventh month
abbreviated name of the eighth month
abbreviated name of the ninth month
abbreviated name of the tenth month
abbreviated name of the eleventh month
abbreviated name of the twelfth month
era description segments
era date format string
era date and time format string
era time format string
alternative symbols for digits
radix character
separator for thousands
affirmative response extended regular expression
negative response extended regular expression
local currency symbol, preceded by '-' if the symbol should appear before the value, '+' if the symbol should appear after the value, or '.' if the symbol should replace the radix character; if the local currency symbol is the empty string, implementations may return the empty string (“”)

The following non-standard FreeBSD extensions are recognized:

Constant Category Description
month/day order
standalone name of the first month
standalone name of the second month
standalone name of the third month
standalone name of the fourth month
standalone name of the fifth month
standalone name of the sixth month
standalone name of the seventh month
standalone name of the eighth month
standalone name of the ninth month
standalone name of the tenth month
standalone name of the eleventh month
standalone name of the twelfth month
affirmative response string
negative response string

In a locale where langinfo data is not defined, nl_langinfo() returns a pointer to the corresponding string in the POSIX locale. nl_langinfo_l() returns the same values as nl_langinfo(). In all locales, nl_langinfo() returns a pointer to an empty string if item contains an invalid setting.

For example:

nl_langinfo(ABDAY_1)

would return a pointer to the string “Dom” if the identified language was Portuguese, and “Sun” if the identified language was English.

setlocale(3)

The nl_langinfo() function conforms to Version 2 of the Single UNIX Specification (“SUSv2”). The nl_langinfo_l() function conforms to IEEE Std 1003.1-2008 (“POSIX.1”).

The nl_langinfo() function first appeared in FreeBSD 4.6.
December 14, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.