std.utf.validate ?
And something like that?
import std.stdio; import std.utf; void main() { ubyte[] bytes = cast(ubyte[])""; writeln("bytes: ", bytes); string str = cast(string)bytes; writeln("string: ", str); validate(str); writeln("valid"); }
Application Output:
bytes: [209, 129, 208, 190, 208, 177, 208, 176, 208, 186, 208, 176] string: valid
sigod source share