| 1803 | } |
| 1804 | |
| 1805 | int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end) |
| 1806 | { |
| 1807 | char* buf_p = out_buf; |
| 1808 | const char* buf_end = out_buf + out_buf_size; |
| 1809 | while (buf_p < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text) |
| 1810 | { |
| 1811 | unsigned int c = (unsigned int)(*in_text++); |
| 1812 | if (c < 0x80) |
| 1813 | *buf_p++ = (char)c; |
| 1814 | else |
| 1815 | buf_p += ImTextCharToUtf8_inline(buf_p, (int)(buf_end - buf_p - 1), c); |
| 1816 | } |
| 1817 | *buf_p = 0; |
| 1818 | return (int)(buf_p - out_buf); |
| 1819 | } |
| 1820 | |
| 1821 | int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end) |
| 1822 | { |
no test coverage detected