MCPcopy Create free account
hub / github.com/PolygonTek/BlueshiftEngine / ImTextStrFromUtf8

Function ImTextStrFromUtf8

Source/ThirdParty/imgui/imgui.cpp:1656–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1654}
1655
1656int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
1657{
1658 ImWchar* buf_out = buf;
1659 ImWchar* buf_end = buf + buf_size;
1660 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
1661 {
1662 unsigned int c;
1663 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
1664 if (c == 0)
1665 break;
1666 *buf_out++ = (ImWchar)c;
1667 }
1668 *buf_out = 0;
1669 if (in_text_remaining)
1670 *in_text_remaining = in_text;
1671 return (int)(buf_out - buf);
1672}
1673
1674int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
1675{

Callers 1

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected