| 2304 | } |
| 2305 | |
| 2306 | int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) |
| 2307 | { |
| 2308 | ImWchar* buf_out = buf; |
| 2309 | ImWchar* buf_end = buf + buf_size; |
| 2310 | while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 2311 | { |
| 2312 | unsigned int c; |
| 2313 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2314 | *buf_out++ = (ImWchar)c; |
| 2315 | } |
| 2316 | *buf_out = 0; |
| 2317 | if (in_text_remaining) |
| 2318 | *in_text_remaining = in_text; |
| 2319 | return (int)(buf_out - buf); |
| 2320 | } |
| 2321 | |
| 2322 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2323 | { |
no test coverage detected