| 2761 | } |
| 2762 | |
| 2763 | int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) |
| 2764 | { |
| 2765 | int bytes_count = 0; |
| 2766 | while ((!in_text_end || in_text < in_text_end) && *in_text) |
| 2767 | { |
| 2768 | unsigned int c = (unsigned int)(*in_text++); |
| 2769 | if (c < 0x80) |
| 2770 | bytes_count++; |
| 2771 | else |
| 2772 | bytes_count += ImTextCountUtf8BytesFromChar(c); |
| 2773 | } |
| 2774 | return bytes_count; |
| 2775 | } |
| 2776 | |
| 2777 | const char* ImTextFindPreviousUtf8Codepoint(const char* in_text_start, const char* in_p) |
| 2778 | { |
no test coverage detected