* Exported function to return whether a UTF-8 string is legal or not. * This is not used here; it's just exported. */
| 554 | * This is not used here; it's just exported. |
| 555 | */ |
| 556 | Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) { |
| 557 | while (*source != sourceEnd) { |
| 558 | int length = trailingBytesForUTF8[**source] + 1; |
| 559 | if (length > sourceEnd - *source || !isLegalUTF8(*source, length)) |
| 560 | return false; |
| 561 | *source += length; |
| 562 | } |
| 563 | return true; |
| 564 | } |
| 565 | |
| 566 | /* --------------------------------------------------------------------- */ |
| 567 |
nothing calls this directly
no test coverage detected