Decode the UTF-8 codepoint ending at position 'pos' (exclusive) and * return its value. Also sets *cplen to the byte length of the codepoint. */
| 235 | return cp; |
| 236 | } else if ((*p & 0xF0) == 0xE0) { |
| 237 | *len = 3; |
| 238 | cp = (*p & 0x0F) << 12; |
| 239 | cp |= (p[1] & 0x3F) << 6; |
| 240 | cp |= (p[2] & 0x3F); |
| 241 | return cp; |
| 242 | } else if ((*p & 0xF8) == 0xF0) { |
| 243 | *len = 4; |
| 244 | cp = (*p & 0x07) << 18; |
| 245 | cp |= (p[1] & 0x3F) << 12; |
| 246 | cp |= (p[2] & 0x3F) << 6; |
| 247 | cp |= (p[3] & 0x3F); |
| 248 | return cp; |
| 249 | } |
| 250 | *len = 1; |
| 251 | return *p; /* Fallback for invalid sequences. */ |
| 252 | } |
| 253 |
no test coverage detected