unicode::canonical, unicode::decompose, unicode::decompose_default_reallocate, unicode::compose,
Contents
Description
These functions implement the C++ interface for the UnicodeCanonicalDecompositionandComposition[1],
See the description of the underlying unicode_canonical(3) C library API for more information. C++
specific notes:
• The C++ decomposition reallocate callback receives a single vector of offset and size tuples instead
of two separate arrays or vectors. unicode::decompose_default_reallocate() is the C++ version of the
default reallocate callback. It receives the receiving the same tuple vector parameter, too. The C++
interface use std::u32strings to represent Unicode text strings, and
unicode::decompose_default_reallocate() resizes it.
Like the C callback, the C++ one gets called 0 or more times.
• unicode::compose() takes care of initializing, applying, and de-initialization the
unicode_composition_t object, for decomposition. The callback receives a reference to the
unicode_composition_t object, which the callback should not modify in any way.
Name
unicode::canonical, unicode::decompose, unicode::decompose_default_reallocate, unicode::compose,
unicode::compose_default_callback - unicode canonical normalization and denormalization
Notes
1. Unicode Canonical Decomposition and Composition
https://www.unicode.org/reports/tr15/tr15-54.html
Courier Unicode Library 05/18/2024 UNICODE::CANONICAL(3)
See Also
courier-unicode(7), unicode_canonical(3).
Synopsis
#include<courier-unicode.h>constexprintdecompose_flag_qc=UNICODE_DECOMPOSE_FLAG_QC;constexprintdecompose_flag_compat=UNICODE_DECOMPOSE_FLAG_COMPAT;constexprintcompose_flag_removeunused=UNICODE_COMPOSE_FLAG_REMOVEUNUSED;constexprintcompose_flag_oneshot=UNICODE_COMPOSE_FLAG_ONESHOT;voiddecompose_default_reallocate(std::u32string&string,conststd::vector<std::tuple<size_t,size_t>>&list);voiddecompose(std::u32string&string,intflags=0,conststd::function<void(std::u32string&,conststd::vector<std::tuple<size_t,size_t>>)>&reallocate=decompose_default_reallocate);voidcompose_default_callback(unicode_composition_t&compositions);voidcompose(std::u32string&string,intflags=0,conststd::function<void(unicode_composition_t&)>&cb=compose_default_reallocate);
