UCHAR(3)

NAME
uchar - Unicode utilities

SYNOPSIS
#include <uchar.h>

DESCRIPTION
The <uchar.h> header file declares types and functions for manipulating Unicode code units.

  Types

char8_t
    (C23) Unsigned integer type for UTF-8 code units.

    Same type as unsigned char.

char16_t
    Unsigned integer type for UTF-16 code units.

    Same type as uint_least16_t from <stdint.h>. May represent both surrogate code points, i.e., code points in the interval [0xd800,0xdfff], and Unicode scalar values in the Basic Multilingual Plane, which are the 16-bit code points other than surrogate code points.

char32_t
    Unsigned integer type for UTF-32 code units.

    Same type as uint_least32_t from <stdint.h>. Can represent all Unicode scalar values, not just those in the Basic Multilingual Plane. Intended to represent only Unicode scalar values, not surrogate code points.

mbstate_t
    Opaque multibyte conversion state.

    Same type as in stddef.h and wchar.h.

size_t
    Unsigned integer type to represent array sizes.

    Same type as in stddef.h, stdint.h, and sys/types.h.

  Functions
The <uchar.h> header file declares the functions mbrtoc8(3), c8rtomb(3), mbrtoc16(3), c16rtomb(3), mbrtoc32(3), and c32rtomb(3) for conversion between multibyte sequences and UTF-8/UTF-16/UTF-32 code units.

SEE ALSO
c8rtomb(3), c16rtomb(3), c32rtomb(3), mbrtoc8(3), mbrtoc16(3), mbrtoc32(3) The Unicode Standard, Version 15.0 — Core Specification, The Unicode Consortium, September 2022, https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf. P. Hoffman, F. Yergeau, UTF-16, an encoding of ISO 10646, RFC 2781, February 2000, Internet Engineering Task Force, https://datatracker.ietf.org/doc/html/rfc2781. F. Yergeau, UTF-8, a transformation format of ISO 10646, RFC 3629, November 2003, Internet Engineering Task Force, https://datatracker.ietf.org/doc/html/rfc3629.

STANDARDS
The <uchar.h> header file conforms to isoC-2011 and p1003.1-2024.

HISTORY
The <uchar.h> header file first appeared in NetBSD 11.0.