MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / ImTextStrToUtf8

Function ImTextStrToUtf8

include/imgui/imgui.cpp:2721–2735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2719}
2720
2721int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
2722{
2723 char* buf_p = out_buf;
2724 const char* buf_end = out_buf + out_buf_size;
2725 while (buf_p < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2726 {
2727 unsigned int c = (unsigned int)(*in_text++);
2728 if (c < 0x80)
2729 *buf_p++ = (char)c;
2730 else
2731 buf_p += ImTextCharToUtf8_inline(buf_p, (int)(buf_end - buf_p - 1), c);
2732 }
2733 *buf_p = 0;
2734 return (int)(buf_p - out_buf);
2735}
2736
2737int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2738{

Callers

nothing calls this directly

Calls 1

ImTextCharToUtf8_inlineFunction · 0.85

Tested by

no test coverage detected