MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / ImTextCountUtf8BytesFromStr

Function ImTextCountUtf8BytesFromStr

engine/3rdparty/imgui/imgui.cpp:2007–2019  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2005}
2006
2007int ImTextCountUtf8BytesFromStr(const ImWchar* in_text, const ImWchar* in_text_end)
2008{
2009 int bytes_count = 0;
2010 while ((!in_text_end || in_text < in_text_end) && *in_text)
2011 {
2012 unsigned int c = (unsigned int)(*in_text++);
2013 if (c < 0x80)
2014 bytes_count++;
2015 else
2016 bytes_count += ImTextCountUtf8BytesFromChar(c);
2017 }
2018 return bytes_count;
2019}
2020
2021//-----------------------------------------------------------------------------
2022// [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