MCPcopy Create free account
hub / github.com/MKXJun/DirectX11-With-Windows-SDK / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

ImGui/imgui.cpp:1990–2002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1988}
1989
1990int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
1991{
1992 int bytes_count = 0;
1993 while ((!in_text_end || in_text < in_text_end) && *in_text)
1994 {
1995 unsigned int c = (unsigned int)(*in_text++);
1996 if (c < 0x80)
1997 bytes_count++;
1998 else
1999 bytes_count += ImTextCountUtf8BytesFromChar(c);
2000 }
2001 return bytes_count;
2002}
2003
2004//-----------------------------------------------------------------------------
2005// [SECTION] MISC HELPERS/UTILITIES (Color functions)

Callers 3

STB_TEXTEDIT_DELETECHARSFunction · 0.85
STB_TEXTEDIT_INSERTCHARSFunction · 0.85
InputTextExMethod · 0.85

Calls 1

Tested by

no test coverage detected