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