MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

lib/imgui/imgui.cpp:1716–1728  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1714}
1715
1716int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1717{
1718 int bytes_count = 0;
1719 while ((!in_text_end || in_text < in_text_end) && *in_text)
1720 {
1721 unsigned int c = (unsigned int)(*in_text++);
1722 if (c < 0x80)
1723 bytes_count++;
1724 else
1725 bytes_count += ImTextCountUtf8BytesFromChar(c);
1726 }
1727 return bytes_count;
1728}
1729
1730//-----------------------------------------------------------------------------
1731// [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