feature. See also
. The project being documented here (as the example) is the Zig library itself.
unicode.testInvalidUtf8ContinuationBytes
fn testInvalidUtf8ContinuationBytes() !void
File
Code
fn testInvalidUtf8ContinuationBytes() !void {
try testError("\x80", error.Utf8InvalidStartByte);
try testError("\xbf", error.Utf8InvalidStartByte);
try testError("\xf8", error.Utf8InvalidStartByte);
try testError("\xff", error.Utf8InvalidStartByte);
try testError("\xc2", error.UnexpectedEof);
try testError("\xc2\x00", error.Utf8ExpectedContinuation);
try testError("\xc2\xc0", error.Utf8ExpectedContinuation);
try testError("\xe0", error.UnexpectedEof);
try testError("\xe0\x00", error.UnexpectedEof);
try testError("\xe0\xc0", error.UnexpectedEof);
try testError("\xe0\xa0", error.UnexpectedEof);
try testError("\xe0\xa0\x00", error.Utf8ExpectedContinuation);
try testError("\xe0\xa0\xc0", error.Utf8ExpectedContinuation);
try testError("\xf0", error.UnexpectedEof);
try testError("\xf0\x00", error.UnexpectedEof);
try testError("\xf0\xc0", error.UnexpectedEof);
try testError("\xf0\x90\x00", error.UnexpectedEof);
try testError("\xf0\x90\xc0", error.UnexpectedEof);
try testError("\xf0\x90\x80\x00", error.Utf8ExpectedContinuation);
try testError("\xf0\x90\x80\xc0", error.Utf8ExpectedContinuation);
}