MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / ImTextStrFromUtf8

Function ImTextStrFromUtf8

samples/luxcoreui/deps/imgui-1.46/imgui.cpp:969–986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967}
968
969int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
970{
971 ImWchar* buf_out = buf;
972 ImWchar* buf_end = buf + buf_size;
973 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
974 {
975 unsigned int c;
976 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
977 if (c == 0)
978 break;
979 if (c < 0x10000) // FIXME: Losing characters that don't fit in 2 bytes
980 *buf_out++ = (ImWchar)c;
981 }
982 *buf_out = 0;
983 if (in_text_remaining)
984 *in_text_remaining = in_text;
985 return (int)(buf_out - buf);
986}
987
988int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
989{

Callers 3

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected