MCPcopy Create free account
hub / github.com/PolygonTek/BlueshiftEngine / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

Source/ThirdParty/imgui/imgui.cpp:1756–1768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1754}
1755
1756int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1757{
1758 int bytes_count = 0;
1759 while ((!in_text_end || in_text < in_text_end) && *in_text)
1760 {
1761 unsigned int c = (unsigned int)(*in_text++);
1762 if (c < 0x80)
1763 bytes_count++;
1764 else
1765 bytes_count += ImTextCountUtf8BytesFromChar(c);
1766 }
1767 return bytes_count;
1768}
1769
1770//-----------------------------------------------------------------------------
1771// [SECTION] MISC HELPERS/UTILTIES (Color functions)

Callers 3

STB_TEXTEDIT_DELETECHARSFunction · 0.85
STB_TEXTEDIT_INSERTCHARSFunction · 0.85
InputTextExMethod · 0.85

Calls 1

Tested by

no test coverage detected