| 88 | } |
| 89 | |
| 90 | std::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 |
| 101 | std::pair<char32_t, size_t> utf8ToCodepoint( const char* s, size_t size ) |
no test coverage detected