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

# querylocale(3)

Get locale name for a specified category

## NAME

**querylocale** – Get locale name for a specified category

## SYNOPSIS

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

*const* *char* *\**\

**querylocale**(*int mask*, *locale\_t loc*);

## DESCRIPTION

Returns the name of the locale for the category specified by *mask*. The *mask* is scanned starting at the least significant bit, until the first set bit is found. This happens to scan the categories alphabetically, not  including LC\_ALL\_MASK, but it is best to specify one category at a time. The available categories are documented in [xlocale(3)](/man/xlocale/3.md) and [newlocale(3)](/man/newlocale/3.md).

## SEE ALSO

[duplocale(3)](/man/duplocale/3.md), [freelocale(3)](/man/freelocale/3.md), [newlocale(3)](/man/newlocale/3.md), [uselocale(3)](/man/uselocale/3.md), [xlocale(3)](/man/xlocale/3.md)
