llvm::json::isUTF8

Returns true if S is valid UTF-8, which is required for use as JSON.

Synopsis

Declared in <llvm/Support/JSON.h>

bool
isUTF8(
    llvm::StringRef S,
    size_t* ErrOffset = nullptr);

Description

If it returns false, Offset is set to a byte offset near the first error.

Return Value

True if S is valid UTF-8.

Parameters

NameDescription
SString to validate.
ErrOffsetOptional output for a byte offset near the first error.