xref: /illumos-gate/usr/src/man/man3head/uchar.h.3head (revision 99ea293e719ac006d413e4fde6ac0d5cd4dd6c59)
1.\"
2.\" This file and its contents are supplied under the terms of the
3.\" Common Development and Distribution License ("CDDL"), version 1.0.
4.\" You may only use this file in accordance with the terms of version
5.\" 1.0 of the CDDL.
6.\"
7.\" A full copy of the text of the CDDL should have accompanied this
8.\" source.  A copy of the CDDL is also available via the Internet at
9.\" http://www.illumos.org/license/CDDL.
10.\"
11.\"
12.\" Copyright 2020 Robert Mustacchi
13.\"
14.Dd April 22, 2020
15.Dt UCHAR.H 3HEAD
16.Os
17.Sh NAME
18.Nm uchar.h
19.Nd unicode utilities header
20.Sh SYNOPSIS
21.In uchar.h
22.Sh DESCRIPTION
23The
24.In uchar.h
25header provides support for the C11 Unicode utilities.
26The types and functions provide means for working with data encoded as
27UTF-16 and UTF-32.
28When working in non-Unicode locales, these types may not represent
29Unicode code points.
30.Pp
31The
32.In uchar.h
33header defines the following types:
34.Bl -tag -width Vt
35.It Vt char16_t
36An unsigned integer that can represent 16-bit characters, generally a
37single single UTF-16 code unit.
38A Unicode code point may be one or two UTF-16 code units due to
39surrogate pairs.
40.It Vt char32_t
41An unsigned integer that can represent 32-bit characters, generally a
42single UTF-32 code unit.
43.It Vt size_t
44An unsigned integer that represents the size of various objects.
45This can hold the result of the
46.Sy sizeof
47operator.
48See also
49.Xr stddef.h 3HEAD .
50.It Vt mbstate_t
51An object that holds the state for converting between character
52sequences and wide characters
53.Po
54.Vt wchar_t ,
55.Vt char16_t ,
56.Vt char32_t
57.Pc .
58See also,
59.Xr wchar.h 3HEAD .
60.El
61The
62.In uchar.h
63header also defines the following functions which are used to convert
64between
65.Vt char16_t
66and
67.Vt char32_t
68sequences and other character sequences:
69.Bl -tag -width cr16rtomb
70.It Xr c16rtomb 3C
71Convert
72.Vt char16_t
73sequences to multi-byte character sequences.
74.It Xr c32rtomb 3C
75Convert
76.Vt char32_t
77sequences to multi-byte character sequences.
78.It Xr mbrtoc16 3C
79Convert multi-byte character sequences to
80.Vt char16_t
81sequences.
82.It Xr mbrtoc32 3C
83Convert multi-byte character sequences to
84.Vt char32_t
85sequences.
86.El
87.Sh INTERFACE STABILITY
88.Sy Committed
89.Sh SEE ALSO
90.Xr c16rtomb 3C ,
91.Xr c32rtomb 3C ,
92.Xr mbrtoc16 3C ,
93.Xr mbrtoc32 3C ,
94.Xr stddef.h 3HEAD ,
95.Xr wchar.h 3HEAD
96