MCPcopy Create free account
hub / github.com/WinMerge/winmerge / queryConvert

Method queryConvert

Externals/poco/Foundation/src/UTF8Encoding.cpp:154–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152
153
154int UTF8Encoding::queryConvert(const unsigned char* bytes, int length) const
155{
156 int n = _charMap[*bytes];
157 int uc;
158 if (-n > length)
159 {
160 return n;
161 }
162 else
163 {
164 switch (n)
165 {
166 case -1:
167 return -1;
168 case -4:
169 case -3:
170 case -2:
171 if (!isLegal(bytes, -n)) return -1;
172 uc = *bytes & ((0x07 << (n + 4)) | 0x03);
173 break;
174 default:
175 return n;
176 }
177 while (n++ < -1)
178 {
179 uc <<= 6;
180 uc |= (*++bytes & 0x3F);
181 }
182 return uc;
183 }
184}
185
186
187int UTF8Encoding::sequenceLength(const unsigned char* bytes, int length) const

Callers 5

operator *Method · 0.45
operator *Method · 0.45
convertMethod · 0.45
readFromDeviceMethod · 0.45
writeToDeviceMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected