| 2076 | } |
| 2077 | |
| 2078 | int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining) |
| 2079 | { |
| 2080 | ImWchar* buf_out = buf; |
| 2081 | ImWchar* buf_end = buf + buf_size; |
| 2082 | while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 2083 | { |
| 2084 | unsigned int c; |
| 2085 | in_text += ImTextCharFromUtf8(&c, in_text, in_text_end); |
| 2086 | if (c == 0) |
| 2087 | break; |
| 2088 | *buf_out++ = (ImWchar)c; |
| 2089 | } |
| 2090 | *buf_out = 0; |
| 2091 | if (in_text_remaining) |
| 2092 | *in_text_remaining = in_text; |
| 2093 | return (int)(buf_out - buf); |
| 2094 | } |
| 2095 | |
| 2096 | int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end) |
| 2097 | { |
no test coverage detected