* Exported function to return the size of the first utf-8 code unit sequence, * Or 0 if the sequence is not valid; */
| 439 | * Or 0 if the sequence is not valid; |
| 440 | */ |
| 441 | unsigned getUTF8SequenceSize(const UTF8 *source, const UTF8 *sourceEnd) { |
| 442 | int length = trailingBytesForUTF8[*source] + 1; |
| 443 | return (length <= sourceEnd - source && isLegalUTF8(source, length)) ? length |
| 444 | : 0; |
| 445 | } |
| 446 | |
| 447 | /* --------------------------------------------------------------------- */ |
| 448 |
no test coverage detected