MCPcopy Create free account
hub / github.com/AlexandreRouma/SDRPlusPlus / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

core/src/imgui/imgui.cpp:1771–1783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1769}
1770
1771int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1772{
1773 int bytes_count = 0;
1774 while ((!in_text_end || in_text < in_text_end) && *in_text)
1775 {
1776 unsigned int c = (unsigned int)(*in_text++);
1777 if (c < 0x80)
1778 bytes_count++;
1779 else
1780 bytes_count += ImTextCountUtf8BytesFromChar(c);
1781 }
1782 return bytes_count;
1783}
1784
1785//-----------------------------------------------------------------------------
1786// [SECTION] MISC HELPERS/UTILITIES (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