| 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) |
nothing calls this directly
no test coverage detected