A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::utf8 Namespace Reference

Functions

bool IsContinuation (char byte)
 Whether byte is a continuation byte – the middle of a character.
 
size_t SequenceWidth (char lead)
 Bytes in the sequence lead starts, from the lead byte alone.
 
size_t Utf16Units (char lead)
 UTF-16 code units the character at lead occupies: 2 above the BMP, else.
 
bool IsValid (std::string_view text)
 Whether text is well-formed UTF-8.
 

Function Documentation

◆ IsContinuation()

bool a11::utf8::IsContinuation ( char  byte)
inline

Whether byte is a continuation byte – the middle of a character.

◆ IsValid()

bool a11::utf8::IsValid ( std::string_view  text)
inline

Whether text is well-formed UTF-8.

Rejects overlong encodings, surrogate code points and values above U+10FFFF.

◆ SequenceWidth()

size_t a11::utf8::SequenceWidth ( char  lead)
inline

Bytes in the sequence lead starts, from the lead byte alone.

Returns a width from the lead byte's range. ASCII and continuation bytes have width 1. Use IsValid() to reject malformed input.

◆ Utf16Units()

size_t a11::utf8::Utf16Units ( char  lead)
inline

UTF-16 code units the character at lead occupies: 2 above the BMP, else.