---
name: "nl_langinfo"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/nl_langinfo"
---

# nl\_langinfo(3)

language information

## NAME

**nl\_langinfo**, **nl\_langinfo\_l** – language information

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<langinfo.h\>**

*char* *\**\

**nl\_langinfo**(*nl\_item item*);

**#include \<langinfo.h\>**

**#include \<xlocale.h\>**

*char* *\**\

**nl\_langinfo\_l**(*nl\_item item*, *locale\_t loc*);

## 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 manifest constant names and values of *item* are defined in ⟨langinfo.h⟩.

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.

## RETURN VALUES

In a locale where langinfo data is not defined, **nl\_langinfo**() returns a pointer to the corresponding string in the POSIX locale. In all locales, **nl\_langinfo**() returns a pointer to an empty string if *item* contains an invalid setting.

## EXAMPLES

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.

While the **nl\_langinfo**() function uses the current locale, the **nl\_langinfo\_l**() function may be passed a locale directly. See [xlocale(3)](/xlocale/3.md) for more information.

## SEE ALSO

[setlocale(3)](/setlocale/3.md), [xlocale(3)](/xlocale/3.md)

## STANDARDS

The **nl\_langinfo**() function conforms to Version 2 of the Single UNIX Specification (“SUSv2”).

## HISTORY

The **nl\_langinfo**() function first appeared in FreeBSD 4.6.
