MCPcopy Create free account
hub / github.com/crossuo/crossuo / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

external/gfx/imgui/imgui.cpp:1834–1846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1832}
1833
1834int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1835{
1836 int bytes_count = 0;
1837 while ((!in_text_end || in_text < in_text_end) && *in_text)
1838 {
1839 unsigned int c = (unsigned int)(*in_text++);
1840 if (c < 0x80)
1841 bytes_count++;
1842 else
1843 bytes_count += ImTextCountUtf8BytesFromChar(c);
1844 }
1845 return bytes_count;
1846}
1847
1848//-----------------------------------------------------------------------------
1849// [SECTION] MISC HELPERS/UTILTIES (Color functions)

Callers 4

STB_TEXTEDIT_DELETECHARSFunction · 0.85
STB_TEXTEDIT_INSERTCHARSFunction · 0.85
InputTextExMethod · 0.85

Calls 1

Tested by

no test coverage detected