| 2094 | } |
| 2095 | |
| 2096 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2097 | { |
| 2098 | int char_count = 0; |
| 2099 | while ((!in_text_end || in_text < in_text_end) && *in_text) |
| 2100 | { |
| 2101 | unsigned int c; |
| 2102 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2103 | if (c == 0) |
| 2104 | break; |
| 2105 | char_count++; |
| 2106 | } |
| 2107 | return char_count; |
| 2108 | } |
| 2109 | |
| 2110 | // Based on stb_to_utf8() from github.com/nothings/stb/ |
| 2111 | static inline int ImTextCharToUtf8_inline(char* buf, int buf_size, unsigned int c) |
no test coverage detected