Validate a null-terminated UTF-8 string. */
| 216 | |
| 217 | /* Validate a null-terminated UTF-8 string. */ |
| 218 | static bool utf8_validate(const char *s) |
| 219 | { |
| 220 | int len; |
| 221 | |
| 222 | for (; *s != 0; s += len) |
| 223 | { |
| 224 | len = utf8_validate_cz(s); |
| 225 | if (len == 0) |
| 226 | return false; |
| 227 | } |
| 228 | |
| 229 | return true; |
| 230 | } |
| 231 | |
| 232 | /* |
| 233 | * Read a single UTF-8 character starting at @s, |
no test coverage detected