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

Function ImTextStrFromUtf8

extern/imgui/imgui.cpp:2078–2094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2076}
2077
2078int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
2079{
2080 ImWchar* buf_out = buf;
2081 ImWchar* buf_end = buf + buf_size;
2082 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2083 {
2084 unsigned int c;
2085 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2086 if (c == 0)
2087 break;
2088 *buf_out++ = (ImWchar)c;
2089 }
2090 *buf_out = 0;
2091 if (in_text_remaining)
2092 *in_text_remaining = in_text;
2093 return (int)(buf_out - buf);
2094}
2095
2096int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2097{

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected