MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / BytesFromLead

Function BytesFromLead

scintilla/src/UniConversion.cxx:136–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134static bool initialisedBytesOfLead = false;
135
136static int BytesFromLead(int leadByte) {
137 if (leadByte < 0xC2) {
138 // Single byte or invalid
139 return 1;
140 } else if (leadByte < 0xE0) {
141 return 2;
142 } else if (leadByte < 0xF0) {
143 return 3;
144 } else if (leadByte < 0xF5) {
145 return 4;
146 } else {
147 // Characters longer than 4 bytes not possible in current UTF-8
148 return 1;
149 }
150}
151
152void UTF8BytesOfLeadInitialise() {
153 if (!initialisedBytesOfLead) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected