| 11672 | |
| 11673 | template <typename Ch, typename F> |
| 11674 | inline void convert(const char* strb, const char* stre, F&& f) { |
| 11675 | char32_t cp = 0; |
| 11676 | for (const char* strtarget = strb; strtarget < stre;) { |
| 11677 | auto dr = unicode::utf8_to_code_point(strtarget, stre); |
| 11678 | if (dr.error != unicode::error_code::ok) { |
| 11679 | cp = unicode::unicode_detail::replacement; |
| 11680 | ++strtarget; |
| 11681 | } |
| 11682 | else { |
| 11683 | cp = dr.codepoint; |
| 11684 | strtarget = dr.next; |
| 11685 | } |
| 11686 | if constexpr (std::is_same_v<Ch, char32_t>) { |
| 11687 | auto er = unicode::code_point_to_utf32(cp); |
| 11688 | f(er); |
| 11689 | } |
| 11690 | else { |
| 11691 | auto er = unicode::code_point_to_utf16(cp); |
| 11692 | f(er); |
| 11693 | } |
| 11694 | } |
| 11695 | } |
| 11696 | |
| 11697 | template <typename BaseCh, typename S> |
| 11698 | inline S get_into(lua_State* L, int index, record& tracking) { |
no test coverage detected