MCPcopy Create free account
hub / github.com/cinder/Cinder / utf16to8

Function utf16to8

include/utf8cpp/unchecked.h:130–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128
129 template <typename u16bit_iterator, typename octet_iterator>
130 octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
131 {
132 while (start != end) {
133 uint32_t cp = utf8::internal::mask16(*start++);
134 // Take care of surrogate pairs first
135 if (utf8::internal::is_lead_surrogate(cp)) {
136 uint32_t trail_surrogate = utf8::internal::mask16(*start++);
137 cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
138 }
139 result = utf8::unchecked::append(cp, result);
140 }
141 return result;
142 }
143
144 template <typename u16bit_iterator, typename octet_iterator>
145 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