| 2141 | } |
| 2142 | |
| 2143 | int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) |
| 2144 | { |
| 2145 | ImWchar* buf_out = buf; |
| 2146 | ImWchar* buf_end = buf + buf_size; |
| 2147 | while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 2148 | { |
| 2149 | unsigned int c; |
| 2150 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2151 | *buf_out++ = (ImWchar)c; |
| 2152 | } |
| 2153 | *buf_out = 0; |
| 2154 | if (in_text_remaining) |
| 2155 | *in_text_remaining = in_text; |
| 2156 | return (int)(buf_out - buf); |
| 2157 | } |
| 2158 | |
| 2159 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2160 | { |
no test coverage detected