[#BloombergLP-bdlde-Utf8Util-numCharactersIfValid-06] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/Utf8Util.adoc[Utf8Util]::numCharactersIfValid :relfileprefix: ../../../ :mrdocs: `numCharactersIfValid` overloads == Synopses Declared in `<bdlde_utf8util.h>` Return the number of Unicode code points in the specified `string` if it contains valid UTF‐8, with no effect on the specified `invalidString`. Otherwise, return a negative value and load into `invalidString` the address of the byte after the last valid Unicode code point traversed. `string` is necessarily null‐terminated, so it cannot contain embedded null bytes. Note that `string` may contain less than `bsl::strlen(string)` Unicode code points. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdlde/Utf8Util/IntPtr.adoc[Utf8Util::IntPtr] xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-0f.adoc[numCharactersIfValid]( char const** invalidString, char const* string); ---- [.small]#xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-0f.adoc[_» more..._]# Return the number of Unicode code points in the specified `string` having the specified `length` (in bytes) if `string` contains valid UTF‐8, with no effect on the specified `invalidString`. Otherwise, return a negative value and load into `invalidString` the address of the byte after the last valid Unicode code point traversed. `string` need not be null‐terminated and may contain embedded null bytes, and `string` may be null if `0 == length` (see {Empty Input Strings}). Note that `string` may contain less than `length` Unicode code points. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdlde/Utf8Util/IntPtr.adoc[Utf8Util::IntPtr] xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-0a.adoc[numCharactersIfValid]( char const** invalidString, char const* string, xref:BloombergLP/bdlde/Utf8Util/size_type.adoc[size_type] length); ---- [.small]#xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#