llvm::json::fixUTF8

Replace invalid UTF-8 sequences in S with U+FFFD.

Synopsis

Declared in <llvm/Support/JSON.h>

std::string
fixUTF8(llvm::StringRef S);

Description

The returned string is valid UTF-8. This is much slower than isUTF8, so test that first.

Return Value

A valid UTF-8 string with invalid sequences replaced.

Parameters

NameDescription
SString that may contain invalid UTF-8.