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

Function ImTextCountUtf8BytesFromStr

KBotExt/imgui/imgui.cpp:2246–2258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2244}
2245
2246int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2247{
2248 int bytes_count = 0;
2249 while ((!in_text_end || in_text < in_text_end) && *in_text)
2250 {
2251 unsigned int c = (unsigned int)(*in_text++);
2252 if (c < 0x80)
2253 bytes_count++;
2254 else
2255 bytes_count += ImTextCountUtf8BytesFromChar(c);
2256 }
2257 return bytes_count;
2258}
2259IM_MSVC_RUNTIME_CHECKS_RESTORE
2260
2261//-----------------------------------------------------------------------------

Callers 3

STB_TEXTEDIT_DELETECHARSFunction · 0.85
STB_TEXTEDIT_INSERTCHARSFunction · 0.85
InputTextExMethod · 0.85

Calls 1

Tested by

no test coverage detected