| 2156 | } |
| 2157 | |
| 2158 | int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) |
| 2159 | { |
| 2160 | ImWchar* buf_out = buf; |
| 2161 | ImWchar* buf_end = buf + buf_size; |
| 2162 | while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 2163 | { |
| 2164 | unsigned int c; |
| 2165 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2166 | *buf_out++ = (ImWchar)c; |
| 2167 | } |
| 2168 | *buf_out = 0; |
| 2169 | if (in_text_remaining) |
| 2170 | *in_text_remaining = in_text; |
| 2171 | return (int)(buf_out - buf); |
| 2172 | } |
| 2173 | |
| 2174 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2175 | { |
no test coverage detected