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

Function ImTextCountCharsFromUtf8

KBotExt/imgui/imgui.cpp:2159–2169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2157}
2158
2159int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2160{
2161 int char_count = 0;
2162 while ((!in_text_end || in_text < in_text_end) && *in_text)
2163 {
2164 unsigned int c;
2165 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2166 char_count++;
2167 }
2168 return char_count;
2169}
2170
2171// Based on stb_to_utf8() from github.com/nothings/stb/
2172static inline int ImTextCharToUtf8_inline(char* buf, int buf_size, unsigned int c)

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected