MCPcopy Create free account
hub / github.com/VictorGordan/opengl-tutorials / ImTextStrFromUtf8

Function ImTextStrFromUtf8

ImGUI GLFW Tutorial/imgui/imgui.cpp:1668–1684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1666}
1667
1668int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
1669{
1670 ImWchar* buf_out = buf;
1671 ImWchar* buf_end = buf + buf_size;
1672 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
1673 {
1674 unsigned int c;
1675 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
1676 if (c == 0)
1677 break;
1678 *buf_out++ = (ImWchar)c;
1679 }
1680 *buf_out = 0;
1681 if (in_text_remaining)
1682 *in_text_remaining = in_text;
1683 return (int)(buf_out - buf);
1684}
1685
1686int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
1687{

Callers 1

InputTextExMethod · 0.70

Calls 1

ImTextCharFromUtf8Function · 0.70

Tested by

no test coverage detected