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

Return the byte length of the UTF&hyphen;8 code point at `codePoint`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
int
numBytesInCodePoint(char const* codePoint);
----

== Description

Return the length (in bytes) of the UTF&hyphen;8&hyphen;encoded code point beginning at the specified `codePoint`&period; The behavior is undefined unless `codePoint` is the address of the first byte of a valid UTF&hyphen;8 encoded character&period; Note that the value returned will be in the range `&lsqb;1 &period;&period; 4&rsqb;`&period; Also note that 1 is returned if `0 &equals;&equals; &ast;codePoint` since &apos;0&apos; is a valid 1&hyphen;byte encoding&period;

== Return Value

length in bytes of the encoded code point

== Parameters

[cols="1,4"]
|===
| Name| Description
| *codePoint*
| address of the first byte of a valid UTF&hyphen;8 code point
|===


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