void AssertAllStringFieldsAreValidUtf8(const google::protobuf::Message &msg, std::string_view msgName)
Debug-only assertion to verify all string fields in a message are valid UTF-8.
std::string ToUtf8(std::string_view input)
Converts input to valid UTF-8.
void SanitizeToUtf8(std::string &s)
In-place convenience overload.
bool IsValidUtf8(const char *data, std::size_t size) noexcept
Validates that a byte sequence is valid UTF-8 per RFC 3629.