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

Function ImTextStrFromUtf8

core/src/imgui/imgui.cpp:1671–1687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected