[#BloombergLP-bdlde-Utf8Util-isValid-04] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/Utf8Util.adoc[Utf8Util]::isValid :relfileprefix: ../../../ :mrdocs: Return whether `string` contains only valid UTF‐8 characters. == Synopsis Declared in `<bdlde_utf8util.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static bool isValid( char const** invalidString, std::string_view const& string); ---- == Description Return `true` if the specified `string` contains only valid UTF‐8 characters, and `false` otherwise. If `string` contains invalid UTF‐8, load into the specified `invalidString` the address of the byte after the last valid code point traversed; `invalidString` is unaffected if `string` contains only valid UTF‐8. `string` need not be null‐terminated and can contain embedded null bytes. == Return Value `true` if `string` is valid UTF‐8, and `false` otherwise == Parameters [cols="1,4"] |=== | Name| Description | *invalidString* | if non‐null, set to after the last valid code point | *string* | UTF‐8 string view to validate |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#