MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ImTextStrToUtf8

Function ImTextStrToUtf8

libs/imgui/imgui.cpp:1211–1225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1209}
1210
1211int ImTextStrToUtf8(char* buf, int buf_size, const ImWchar* in_text, const ImWchar* in_text_end)
1212{
1213 char* buf_out = buf;
1214 const char* buf_end = buf + buf_size;
1215 while (buf_out < buf_end-1 && (!in_text_end || in_text < in_text_end) && *in_text)
1216 {
1217 unsigned int c = (unsigned int)(*in_text++);
1218 if (c < 0x80)
1219 *buf_out++ = (char)c;
1220 else
1221 buf_out += ImTextCharToUtf8(buf_out, (int)(buf_end-buf_out-1), c);
1222 }
1223 *buf_out = 0;
1224 return (int)(buf_out - buf);
1225}
1226
1227int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1228{

Callers 2

InputTextExMethod · 0.85

Calls 1

ImTextCharToUtf8Function · 0.85

Tested by

no test coverage detected