1UNICODE::CANONICAL(3)       Courier Unicode Library      UNICODE::CANONICAL(3)
2
3
4

NAME

6       unicode::canonical, unicode::decompose,
7       unicode::decompose_default_reallocate, unicode::compose,
8       unicode::compose_default_callback - unicode canonical normalization and
9       denormalization
10

SYNOPSIS

12       #include <courier-unicode.h>
13
14       constexpr int decompose_flag_qc=UNICODE_DECOMPOSE_FLAG_QC;
15       constexpr int decompose_flag_compat=UNICODE_DECOMPOSE_FLAG_COMPAT;
16
17       constexpr int compose_flag_removeunused=UNICODE_COMPOSE_FLAG_REMOVEUNUSED;
18       constexpr int compose_flag_oneshot=UNICODE_COMPOSE_FLAG_ONESHOT;
19
20       void decompose_default_reallocate(std::u32string &string,
21                                         const std::vector<std::tuple<size_t, size_t>> &list);
22
23       void decompose(std::u32string &string, int flags=0,
24                      const std::function<void (std::u32string &, const std::vector<std::tuple<size_t, size_t>>)> &reallocate=decompose_default_reallocate);
25
26       void compose_default_callback(unicode_composition_t &compositions);
27
28       void compose(std::u32string &string, int flags=0,
29                    const std::function<void (unicode_composition_t &)> &cb=compose_default_reallocate);
30

DESCRIPTION

32       These functions implement the C++ interface for the Unicode Canonical
33       Decomposition and Composition[1], See the description of the underlying
34       unicode_canonical(3) C library API for more information. C++ specific
35       notes:
36
37       •   The C++ decomposition reallocate callback receives a single vector
38           of offset and size tuples instead of two separate arrays or
39           vectors.  unicode::decompose_default_reallocate() is the C++
40           version of the default reallocate callback. It receives the
41           receiving the same tuple vector parameter, too. The C++ interface
42           use std::u32strings to represent Unicode text strings, and
43           unicode::decompose_default_reallocate() resizes it.
44
45           Like the C callback, the C++ one gets called 0 or more times.
46
47unicode::compose() takes care of initializing, applying, and
48           de-initialization the unicode_composition_t object, for
49           decomposition. The callback receives a reference to the
50           unicode_composition_t object, which the callback should not modify
51           in any way.
52

SEE ALSO

54       courier-unicode(7), unicode_canonical(3).
55

AUTHOR

57       Sam Varshavchik
58           Author
59

NOTES

61        1. Unicode Canonical Decomposition and Composition
62           https://www.unicode.org/reports/tr15/tr15-50.html
63
64
65
66Courier Unicode Library           04/16/2022             UNICODE::CANONICAL(3)
Impressum