MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / ImTextStrToUtf8

Function ImTextStrToUtf8

TheForceEngine/TFE_Ui/imGUI/imgui.cpp:2393–2407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2391}
2392
2393int ImTextStrToUtf8(char* out_buf, int out_buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
2394{
2395 char* buf_p = out_buf;
2396 const char* buf_end = out_buf + out_buf_size;
2397 while (buf_p < buf_end - 1 && (!in_text_end || in_text < in_text_end) && *in_text)
2398 {
2399 unsigned int c = (unsigned int)(*in_text++);
2400 if (c < 0x80)
2401 *buf_p++ = (char)c;
2402 else
2403 buf_p += ImTextCharToUtf8_inline(buf_p, (int)(buf_end - buf_p - 1), c);
2404 }
2405 *buf_p = 0;
2406 return (int)(buf_p - out_buf);
2407}
2408
2409int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2410{

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharToUtf8_inlineFunction · 0.85

Tested by

no test coverage detected