* Exported function to return whether a UTF-8 string is legal or not. * This is not used here; it's just exported. */
| 527 | * This is not used here; it's just exported. |
| 528 | */ |
| 529 | Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) { |
| 530 | while (*source != sourceEnd) { |
| 531 | int length = trailingBytesForUTF8[**source] + 1; |
| 532 | if (length > sourceEnd - *source || !isLegalUTF8(*source, length)) |
| 533 | return false; |
| 534 | *source += length; |
| 535 | } |
| 536 | return true; |
| 537 | } |
| 538 | |
| 539 | /* --------------------------------------------------------------------- */ |
| 540 |