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

Utility for validating and navigating UTF&hyphen;8 encoded strings&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Utf8Util;
----

== Description

This `struct` provides a namespace for static methods used for validating UTF&hyphen;8 strings, for counting the number of Unicode code points in them, for advancing pointers through UTF&hyphen;8 strings by a specified number of Unicode code points, for counting the number of bytes a UTF&hyphen;8 leading substring occupies, for counting the number of bytes in a UTF&hyphen;8 character, and for appending a Unicode character to a UTF&hyphen;8 string&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8Util/IntPtr.adoc[`IntPtr`] 
| This `typedef` is an alias to `bsls&colon;&colon;Types&colon;&colon;IntPtr`&period;
| xref:BloombergLP/bdlde/Utf8Util/Uint64.adoc[`Uint64`] 
| This `typedef` is an alias to `bsls&colon;&colon;Types&colon;&colon;Uint64`&period;
| xref:BloombergLP/bdlde/Utf8Util/UintPtr.adoc[`UintPtr`] 
| This `typedef` is an alias to `bsls&colon;&colon;Types&colon;&colon;UintPtr`&period;
| xref:BloombergLP/bdlde/Utf8Util/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `bsls&colon;&colon;Types&colon;&colon;size&lowbar;type`&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8Util/_04enum.adoc[`Unnamed enum`] 
| Substitution code point constants&period;
| xref:BloombergLP/bdlde/Utf8Util/ErrorStatus.adoc[`ErrorStatus`] 
| Negative status codes returned when UTF&hyphen;8 validation fails&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlde/Utf8Util/advanceIfValid-0a.adoc[`advanceIfValid`] 
| `advanceIfValid` overloads
| xref:BloombergLP/bdlde/Utf8Util/advanceRaw-06d.adoc[`advanceRaw`] 
| `advanceRaw` overloads
| xref:BloombergLP/bdlde/Utf8Util/appendUtf8Character.adoc[`appendUtf8Character`] 
| Append the UTF&hyphen;8 encoding of `codePoint` to `output`&period;
| xref:BloombergLP/bdlde/Utf8Util/appendUtf8CodePoint-01.adoc[`appendUtf8CodePoint`] 
| Append the UTF&hyphen;8 encoding of `codePoint` to `output`&period;
| xref:BloombergLP/bdlde/Utf8Util/codePointValue.adoc[`codePointValue`] 
| Return the numeric value of the UTF&hyphen;8 code point at `codePoint`&period;
| xref:BloombergLP/bdlde/Utf8Util/getByteSize.adoc[`getByteSize`] 
| Return the byte length of the UTF&hyphen;8 code point at `codePoint`&period;
| xref:BloombergLP/bdlde/Utf8Util/getLineAndColumnNumber-0d.adoc[`getLineAndColumnNumber`] 
| Load line and column information for `byteOffset` in `input`&period;
| xref:BloombergLP/bdlde/Utf8Util/isValid-02.adoc[`isValid`] 
| `isValid` overloads
| xref:BloombergLP/bdlde/Utf8Util/isValidCodePoint.adoc[`isValidCodePoint`] 
| Return whether `codePoint` begins a valid UTF&hyphen;8 code point&period;
| xref:BloombergLP/bdlde/Utf8Util/numBytesIfValid.adoc[`numBytesIfValid`] 
| Return the byte length of the first `numCodePoints` encodings&period;
| xref:BloombergLP/bdlde/Utf8Util/numBytesInCodePoint.adoc[`numBytesInCodePoint`] 
| Return the byte length of the UTF&hyphen;8 code point at `codePoint`&period;
| xref:BloombergLP/bdlde/Utf8Util/numBytesRaw.adoc[`numBytesRaw`] 
| Return the byte length of the first `numCodePoints` encodings&period;
| xref:BloombergLP/bdlde/Utf8Util/numCharacters-01.adoc[`numCharacters`] 
| `numCharacters` overloads
| xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-06.adoc[`numCharactersIfValid`] 
| Return the Unicode code&hyphen;point count if `string` is valid UTF&hyphen;8&period;
| xref:BloombergLP/bdlde/Utf8Util/numCharactersRaw-0b.adoc[`numCharactersRaw`] 
| `numCharactersRaw` overloads
| xref:BloombergLP/bdlde/Utf8Util/numCodePointsIfValid-088.adoc[`numCodePointsIfValid`] 
| `numCodePointsIfValid` overloads
| xref:BloombergLP/bdlde/Utf8Util/numCodePointsRaw-0c.adoc[`numCodePointsRaw`] 
| Return the Unicode code&hyphen;point count in `string`&period;
| xref:BloombergLP/bdlde/Utf8Util/readIfValid.adoc[`readIfValid`] 
| Copy valid UTF&hyphen;8 from `input` into `outputBuffer`&period;
| xref:BloombergLP/bdlde/Utf8Util/replaceErrors-0f.adoc[`replaceErrors`] 
| Replace UTF&hyphen;8 error sequences in `input` and write to `output`&period;
| xref:BloombergLP/bdlde/Utf8Util/toAscii.adoc[`toAscii`] 
| Return the string name of the `ErrorStatus` enumerator for `value`&period;
|===



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