MCPcopy Create free account
hub / github.com/RenderKit/embree / ImTextCountCharsFromUtf8

Function ImTextCountCharsFromUtf8

tutorials/common/imgui/imgui.cpp:2034–2046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2032}
2033
2034int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2035{
2036 int char_count = 0;
2037 while ((!in_text_end || in_text < in_text_end) && *in_text)
2038 {
2039 unsigned int c;
2040 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2041 if (c == 0)
2042 break;
2043 char_count++;
2044 }
2045 return char_count;
2046}
2047
2048// Based on stb_to_utf8() from github.com/nothings/stb/
2049static inline int ImTextCharToUtf8_inline(char* buf, int buf_size, unsigned int c)

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected