| 2032 | } |
| 2033 | |
| 2034 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2035 | { |
| 2036 | int char_count = 0; |
| 2037 | while ((!in_text_end || in_text < in_text_end) && *in_text) |
| 2038 | { |
| 2039 | unsigned int c; |
| 2040 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2041 | if (c == 0) |
| 2042 | break; |
| 2043 | char_count++; |
| 2044 | } |
| 2045 | return char_count; |
| 2046 | } |
| 2047 | |
| 2048 | // Based on stb_to_utf8() from github.com/nothings/stb/ |
| 2049 | static inline int ImTextCharToUtf8_inline(char* buf, int buf_size, unsigned int c) |
no test coverage detected