71 std::vector<utf8_byte_seq>& out)
76 constexpr std::uint32_t length_max[4] {0x7FU, 0x7FFU, 0xFFFFU, 0x10FFFFU};
77 for (
const std::uint32_t max : length_max) {
78 if (start <= max && max < end) {
84 for (
unsigned i = 1; i < 4; ++i) {
85 const std::uint32_t mask {(1U << (6U * i)) - 1U};
86 if ((start & ~mask) != (end & ~mask)) {
87 if ((start & mask) != 0U) {
92 if ((end & mask) != mask) {
99 std::uint8_t start_bytes[4] {};
100 std::uint8_t end_bytes[4] {};
105 for (std::size_t j = 0; j < n; ++j) {
106 seq.parts[j] = {.lo = start_bytes[j], .hi = end_bytes[j]};
constexpr std::vector< utf8_byte_seq > utf8_range_sequences(std::uint32_t lo, std::uint32_t hi)
Canonical UTF-8 byte-range sequences for the code-point range [lo, hi], excluding the surrogate block...
constexpr void utf8_push_range(std::uint32_t start, std::uint32_t end, std::vector< utf8_byte_seq > &out)
Splits [start, end] (same UTF-8 length after the length-boundary split) into contiguous byte-range se...