MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / ImTextCountCharsFromUtf8

Function ImTextCountCharsFromUtf8

extern/imgui/imgui.cpp:2096–2108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2094}
2095
2096int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2097{
2098 int char_count = 0;
2099 while ((!in_text_end || in_text < in_text_end) && *in_text)
2100 {
2101 unsigned int c;
2102 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2103 if (c == 0)
2104 break;
2105 char_count++;
2106 }
2107 return char_count;
2108}
2109
2110// Based on stb_to_utf8() from github.com/nothings/stb/
2111static 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