MCPcopy Create free account
hub / github.com/Icinga/icinga2 / utf16to8

Function utf16to8

third-party/utf8cpp/source/utf8/unchecked.h:154–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153 template <typename u16bit_iterator, typename octet_iterator>
154 octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
155 {
156 while (start != end) {
157 uint32_t cp = utf8::internal::mask16(*start++);
158 // Take care of surrogate pairs first
159 if (utf8::internal::is_lead_surrogate(cp)) {
160 uint32_t trail_surrogate = utf8::internal::mask16(*start++);
161 cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
162 }
163 result = utf8::unchecked::append(cp, result);
164 }
165 return result;
166 }
167
168 template <typename u16bit_iterator, typename octet_iterator>
169 u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)

Callers

nothing calls this directly

Calls 3

mask16Function · 0.85
is_lead_surrogateFunction · 0.85
appendFunction · 0.70

Tested by

no test coverage detected