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

Function Utf8ByteCount

crengine/src/lvstring.cpp:2118–2132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2116}
2117
2118int Utf8ByteCount( const lChar16 * str )
2119{
2120 int count = 0;
2121 lUInt16 ch;
2122 while ( (ch=*str++) ) {
2123 if ( (ch & 0xFF80) == 0 ) {
2124 count++;
2125 } else if ( (ch & 0xF800) == 0 ) {
2126 count += 2;
2127 } else {
2128 count += 3;
2129 }
2130 }
2131 return count;
2132}
2133
2134lString16 Utf8ToUnicode( const lString8 & str )
2135{

Callers 1

UnicodeToUtf8Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected