UCHAR(3)
β¨ UCHAR β¨
okay bestie, so this one is uchar β literally the Unicode utilities page, and it's giving "short but mighty" π
the manual name is folded in right here so you don't have to hunt for it, and it lives in the Library Functions Manual section of your fave Debian box.
πΈ SYNOPSIS πΈ
#include <uchar.h>
that's it. that's the whole synopsis. one include. iconic behavior honestly π
π DESCRIPTION π
so the <uchar.h> header file declares types and functions for manipulating Unicode code units. code units, bestie, not code points β there's a difference and this header is very serious about it π«Ά
π¦ Types π¦
char8_tβ (C23) unsigned integer type for UTF-8 code units. highkey the baby of the group π± Same type asunsigned char.char16_tβ unsigned integer type for UTF-16 code units. Same type asuint_least16_tfrom<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. so it's got range, we love that for it πchar32_tβ unsigned integer type for UTF-32 code units. Same type asuint_least32_tfrom<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 β read that again, it's a whole vibe check on surrogates and they do not pass πmbstate_tβ opaque multibyte conversion state. it's opaque, she's mysterious, she's not showing you her internals π Same type as instddef.handwchar.h.size_tβ unsigned integer type to represent array sizes. the classic, the legend, the one everybody already knows π Same type as instddef.h,stdint.h, andsys/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. so like, mbr-to-c goes one way and c-to-mbr goes the other, and yes the naming is a whole gymnastic routine but you'll get used to it fr fr β
π₯ SEE ALSO π₯
c8rtomb(3),c16rtomb(3),c32rtomb(3),mbrtoc8(3),mbrtoc16(3),mbrtoc32(3)β the whole squad, go read them
The Unicode Standard, https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf, The Unicode Consortium, September 2022, Version 15.0 β Core Specification.
P. Hoffman and F. Yergeau, UTF-16, an encoding of ISO 10646, Internet Engineering Task Force, RFC 2781, https://datatracker.ietf.org/doc/html/rfc2781, February 2000.
F. Yergeau, UTF-8, a transformation format of ISO 10646, Internet Engineering Task Force, RFC 3629, https://datatracker.ietf.org/doc/html/rfc3629, November 2003.
π STANDARDS π
The <uchar.h> header file conforms to ISO/IEC 9899:2011 ("ISO C11") and . β yeah, the original page literally trails off with "and ." right there, and no I'm not fixing it, not me editing the sacred text π keep it exactly as it is, bestie.
π HISTORY π
The <uchar.h> header file first appeared in NetBSD 11.0. she's new here and she's already main character energy β¨
π«Ά reminder because it matters: those surrogate code points inchar16_tare allowed there. don't go assuming everychar16_tis a real scalar value, or the standard will side-eye you. andchar32_tis intended for scalar values only β no surrogate shenanigans, periodt π
and that's the whole page, bestie!! source/version says Debian and the date on this beauty is August 15, 2024, filed under UCHAR(3) π catch you in the next man page, mwah π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2024 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms