[#BloombergLP-bdlde-Utf8Util] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlde.adoc[bdlde]::Utf8Util :relfileprefix: ../../ :mrdocs: Utility for validating and navigating UTF‐8 encoded strings. == Synopsis Declared in `<bdlde_utf8util.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- struct Utf8Util; ---- == Description This `struct` provides a namespace for static methods used for validating UTF‐8 strings, for counting the number of Unicode code points in them, for advancing pointers through UTF‐8 strings by a specified number of Unicode code points, for counting the number of bytes a UTF‐8 leading substring occupies, for counting the number of bytes in a UTF‐8 character, and for appending a Unicode character to a UTF‐8 string. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlde/Utf8Util/IntPtr.adoc[`IntPtr`] | This `typedef` is an alias to `bsls::Types::IntPtr`. | xref:BloombergLP/bdlde/Utf8Util/Uint64.adoc[`Uint64`] | This `typedef` is an alias to `bsls::Types::Uint64`. | xref:BloombergLP/bdlde/Utf8Util/UintPtr.adoc[`UintPtr`] | This `typedef` is an alias to `bsls::Types::UintPtr`. | xref:BloombergLP/bdlde/Utf8Util/size_type.adoc[`size_type`] | This `typedef` is an alias to `bsls::Types::size_type`. |=== == Enums [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlde/Utf8Util/_04enum.adoc[`Unnamed enum`] | Substitution code point constants. | xref:BloombergLP/bdlde/Utf8Util/ErrorStatus.adoc[`ErrorStatus`] | Negative status codes returned when UTF‐8 validation fails. |=== == 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‐8 encoding of `codePoint` to `output`. | xref:BloombergLP/bdlde/Utf8Util/appendUtf8CodePoint-01.adoc[`appendUtf8CodePoint`] | Append the UTF‐8 encoding of `codePoint` to `output`. | xref:BloombergLP/bdlde/Utf8Util/codePointValue.adoc[`codePointValue`] | Return the numeric value of the UTF‐8 code point at `codePoint`. | xref:BloombergLP/bdlde/Utf8Util/getByteSize.adoc[`getByteSize`] | Return the byte length of the UTF‐8 code point at `codePoint`. | xref:BloombergLP/bdlde/Utf8Util/getLineAndColumnNumber-0d.adoc[`getLineAndColumnNumber`] | Load line and column information for `byteOffset` in `input`. | xref:BloombergLP/bdlde/Utf8Util/isValid-02.adoc[`isValid`] | `isValid` overloads | xref:BloombergLP/bdlde/Utf8Util/isValidCodePoint.adoc[`isValidCodePoint`] | Return whether `codePoint` begins a valid UTF‐8 code point. | xref:BloombergLP/bdlde/Utf8Util/numBytesIfValid.adoc[`numBytesIfValid`] | Return the byte length of the first `numCodePoints` encodings. | xref:BloombergLP/bdlde/Utf8Util/numBytesInCodePoint.adoc[`numBytesInCodePoint`] | Return the byte length of the UTF‐8 code point at `codePoint`. | xref:BloombergLP/bdlde/Utf8Util/numBytesRaw.adoc[`numBytesRaw`] | Return the byte length of the first `numCodePoints` encodings. | xref:BloombergLP/bdlde/Utf8Util/numCharacters-01.adoc[`numCharacters`] | `numCharacters` overloads | xref:BloombergLP/bdlde/Utf8Util/numCharactersIfValid-06.adoc[`numCharactersIfValid`] | Return the Unicode code‐point count if `string` is valid UTF‐8. | 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‐point count in `string`. | xref:BloombergLP/bdlde/Utf8Util/readIfValid.adoc[`readIfValid`] | Copy valid UTF‐8 from `input` into `outputBuffer`. | xref:BloombergLP/bdlde/Utf8Util/replaceErrors-0f.adoc[`replaceErrors`] | Replace UTF‐8 error sequences in `input` and write to `output`. | xref:BloombergLP/bdlde/Utf8Util/toAscii.adoc[`toAscii`] | Return the string name of the `ErrorStatus` enumerator for `value`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#