xref: /netbsd-src/share/man/man3/uchar.3 (revision c4e44ee2eb8d7b7536566c95c29b6aa6305966b2)
1.\"	$NetBSD: uchar.3,v 1.2 2024/08/15 21:19:45 riastradh Exp $
2.\"
3.\" Copyright (c) 2024 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd August 15, 2024
28.Dt UCHAR 3
29.Os
30.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
31.Sh NAME
32.Nm uchar
33.Nd Unicode utilities
34.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
35.Sh SYNOPSIS
36.In uchar.h
37.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
38.Sh DESCRIPTION
39The
40.In uchar.h
41header file declares types and functions for manipulating Unicode code
42units.
43.\""""""""""""""""""""""""""""""""""""""
44.Ss Types
45.Bl -tag -width ".Vt char32_t"
46.It Vt char8_t
47(C23)
48Unsigned integer type for UTF-8 code units.
49.Pp
50Same type as
51.Vt unsigned char .
52.It Vt char16_t
53Unsigned integer type for UTF-16 code units.
54.Pp
55Same type as
56.Vt uint_least16_t
57from
58.In stdint.h .
59May represent both surrogate code points, i.e., code points in the
60interval [0xd800,0xdfff], and Unicode scalar values in the Basic
61Multilingual Plane, which are the 16-bit code points other than
62surrogate code points.
63.It Vt char32_t
64Unsigned integer type for UTF-32 code units.
65.Pp
66Same type as
67.Vt uint_least32_t
68from
69.In stdint.h .
70Can represent all Unicode scalar values, not just those in the Basic
71Multilingual Plane.
72Intended to represent only Unicode scalar values, not surrogate code
73points.
74.It Vt mbstate_t
75Opaque multibyte conversion state.
76.Pp
77Same type as in
78.Vt stddef.h
79and
80.Vt wchar.h .
81.It Vt size_t
82Unsigned integer type to represent array sizes.
83.Pp
84Same type as in
85.Vt stddef.h ,
86.Vt stdint.h ,
87and
88.Vt sys/types.h .
89.El
90.\""""""""""""""""""""""""""""""""""""""
91.Ss Functions
92The
93.In uchar.h
94header file declares the functions
95.Xr mbrtoc8 3 ,
96.Xr c8rtomb 3 ,
97.Xr mbrtoc16 3 ,
98.Xr c16rtomb 3 ,
99.Xr mbrtoc32 3 ,
100and
101.Xr c32rtomb 3
102for conversion between multibyte sequences and UTF-8/UTF-16/UTF-32 code
103units.
104.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
105.Sh SEE ALSO
106.Xr c8rtomb 3 ,
107.Xr c16rtomb 3 ,
108.Xr c32rtomb 3 ,
109.Xr mbrtoc8 3 ,
110.Xr mbrtoc16 3 ,
111.Xr mbrtoc32 3
112.Rs
113.%B The Unicode Standard
114.%O Version 15.0 \(em Core Specification
115.%Q The Unicode Consortium
116.%D September 2022
117.%U https://www.unicode.org/versions/Unicode15.0.0/UnicodeStandard-15.0.pdf
118.Re
119.Rs
120.%A P. Hoffman
121.%A F. Yergeau
122.%T UTF-16, an encoding of ISO 10646
123.%R RFC 2781
124.%D February 2000
125.%I Internet Engineering Task Force
126.%U https://datatracker.ietf.org/doc/html/rfc2781
127.Re
128.Rs
129.%A F. Yergeau
130.%T UTF-8, a transformation format of ISO 10646
131.%R RFC 3629
132.%D November 2003
133.%I Internet Engineering Task Force
134.%U https://datatracker.ietf.org/doc/html/rfc3629
135.Re
136.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
137.Sh STANDARDS
138The
139.In uchar.h
140header file conforms to
141.St -isoC-2011
142.\" .St -isoC-2023
143.\" .\" XXX PR misc/58600: man pages lack C17, C23, C++98, C++03, C++11, C++17, C++20, C++23 citation syntax
144and
145.St -p1003.1-2024 .
146.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
147.Sh HISTORY
148The
149.In uchar.h
150header file first appeared in
151.Nx 11.0 .
152