MCPcopy Create free account
hub / github.com/buggins/coolreader / Utf8CharCount

Function Utf8CharCount

crengine/src/lvstring.cpp:2074–2092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2072const lString8 lString8::empty_str;
2073
2074int Utf8CharCount( const lChar8 * str )
2075{
2076 int count = 0;
2077 lUInt8 ch;
2078 while ( (ch=*str++) ) {
2079 if ( (ch & 0x80) == 0 ) {
2080 } else if ( (ch & 0xE0) == 0xC0 ) {
2081 if ( !(ch=*str++) )
2082 break;
2083 } else {
2084 if ( !(ch=*str++) )
2085 break;
2086 if ( !(ch=*str++) )
2087 break;
2088 }
2089 count++;
2090 }
2091 return count;
2092}
2093
2094int Utf8CharCount( const lChar8 * str, int len )
2095{

Callers 1

Utf8ToUnicodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected