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

Function utf8to16

include/utf8cpp/unchecked.h:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143
144 template <typename u16bit_iterator, typename octet_iterator>
145 u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
146 {
147 while (start < end) {
148 uint32_t cp = utf8::unchecked::next(start);
149 if (cp > 0xffff) { //make a surrogate pair
150 *result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
151 *result++ = static_cast<uint16_t>((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN);
152 }
153 else
154 *result++ = static_cast<uint16_t>(cp);
155 }
156 return result;
157 }
158
159 template <typename octet_iterator, typename u32bit_iterator>
160 octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)

Callers

nothing calls this directly

Calls 1

nextFunction · 0.70

Tested by

no test coverage detected