MCPcopy Create free account
hub / github.com/RenderKit/embree / ImTextStrFromUtf8

Function ImTextStrFromUtf8

tutorials/common/imgui/imgui.cpp:2016–2032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2014}
2015
2016int ImTextStrFromUtf8(ImWchar* buf, int buf_size, const char* in_text, const char* in_text_end, const char** in_text_remaining)
2017{
2018 ImWchar* buf_out = buf;
2019 ImWchar* buf_end = buf + buf_size;
2020 while (buf_out < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2021 {
2022 unsigned int c;
2023 in_text += ImTextCharFromUtf8(&c, in_text, in_text_end);
2024 if (c == 0)
2025 break;
2026 *buf_out++ = (ImWchar)c;
2027 }
2028 *buf_out = 0;
2029 if (in_text_remaining)
2030 *in_text_remaining = in_text;
2031 return (int)(buf_out - buf);
2032}
2033
2034int ImTextCountCharsFromUtf8(const char* in_text, const char* in_text_end)
2035{

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharFromUtf8Function · 0.85

Tested by

no test coverage detected