MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / ImTextStrToUtf8

Function ImTextStrToUtf8

plugins/Cardinal/src/DearImGui/imgui.cpp:1805–1819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1803}
1804
1805int 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
1821int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1822{

Callers 1

InputTextExMethod · 0.85

Calls 1

ImTextCharToUtf8_inlineFunction · 0.85

Tested by

no test coverage detected