| 2586 | } |
| 2587 | |
| 2588 | int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end) |
| 2589 | { |
| 2590 | char* buf_p = out_buf; |
| 2591 | const char* buf_end = out_buf + out_buf_size; |
| 2592 | while (buf_p < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 2593 | { |
| 2594 | unsigned int c = (unsigned int)(*in_text++); |
| 2595 | if (c < 0x80) |
| 2596 | *buf_p++ = (char)c; |
| 2597 | else |
| 2598 | buf_p += ImTextCharToUtf8_inline(buf_p, (int)(buf_end - buf_p - 1), c); |
| 2599 | } |
| 2600 | *buf_p = 0; |
| 2601 | return (int)(buf_p - out_buf); |
| 2602 | } |
| 2603 | |
| 2604 | int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) |
| 2605 | { |
nothing calls this directly
no test coverage detected