MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / utf8substr

Function utf8substr

source/MRMesh/MRStringConvert.cpp:90–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90std::string utf8substr( const char * s, size_t pos, size_t count )
91{
92 if ( !s )
93 {
94 assert( false );
95 return {};
96 }
97 return wideToUtf8( utf8ToWide( s ).substr( pos, count ).c_str() );
98}
99
100// based on https://github.com/skeeto/branchless-utf8 and ImTextCharFromUtf8 from ImGui
101std::pair<char32_t, size_t> utf8ToCodepoint( const char* s, size_t size )

Callers 1

composeKeyFunction · 0.85

Calls 2

wideToUtf8Function · 0.85
utf8ToWideFunction · 0.70

Tested by

no test coverage detected