MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ImTextStrFromUtf8

Function ImTextStrFromUtf8

3rdparty/imgui/src/imgui.cpp:2660–2674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2658}
2659
2660int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
2661{
2662 ImWchar* buf_out = buf;
2663 ImWchar* buf_end = buf + buf_size;
2664 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2665 {
2666 unsigned int c;
2667 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2668 *buf_out++ = (ImWchar)c;
2669 }
2670 *buf_out = 0;
2671 if (in_text_remaining)
2672 *in_text_remaining = in_text;
2673 return (int)(buf_out - buf);
2674}
2675
2676int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2677{

Callers

nothing calls this directly

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected