MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImTextStrFromUtf8

Function ImTextStrFromUtf8

KBotExt/imgui/imgui.cpp:2143–2157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2141}
2142
2143int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
2144{
2145 ImWchar* buf_out = buf;
2146 ImWchar* buf_end = buf + buf_size;
2147 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2148 {
2149 unsigned int c;
2150 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2151 *buf_out++ = (ImWchar)c;
2152 }
2153 *buf_out = 0;
2154 if (in_text_remaining)
2155 *in_text_remaining = in_text;
2156 return (int)(buf_out - buf);
2157}
2158
2159int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2160{

Callers 3

ComboAutoSelectComplexFunction · 0.85
InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected