[#BloombergLP-bdlde-Utf8Util-numCharactersIfValid-06]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::xref:BloombergLP/bdlde/Utf8Util.adoc[Utf8Util]::numCharactersIfValid
:relfileprefix: ../../../
:mrdocs:

Return the Unicode code&hyphen;point count if `string` is valid UTF&hyphen;8&period;

== Synopses

Declared in `&lt;bdlde&lowbar;utf8util&period;h&gt;`

Return the Unicode code&hyphen;point count if `string` is valid UTF&hyphen;8&period;


[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&period;&period;&period;_]#

Return the Unicode code&hyphen;point count if `string` is valid UTF&hyphen;8&period;


[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&lowbar;type] length);
----

[.small]#xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-0a.adoc[_» more&period;&period;&period;_]#

== Return Value

code&hyphen;point count on success, or a negative value on invalid UTF&hyphen;8

== Parameters

[cols="1,4"]
|===
| Name| Description
| *invalidString*
| if non&hyphen;null, set to after the last valid code point
| *string*
| null&hyphen;terminated UTF&hyphen;8 input to examine
| *length*
| length of `string` in bytes
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
