validate

Checks to see if str is well-formed unicode or not.

@safe pure
void
validate
(
S
)
(
in S str
)

Throws

UTFException if str is not well-formed.

Examples

import std.exception : assertThrown;
char[] a = [167, 133, 175];
assertThrown!UTFException(validate(a));

Meta