Module regex_automata::util::utf8

source ·
Expand description

Utilities for dealing with UTF-8.

This module provides some UTF-8 related helper routines, including an incremental decoder.

Functions

  • decode 🔒
    Decodes the next UTF-8 encoded codepoint from the given byte slice.
  • Decodes the last UTF-8 encoded codepoint from the given byte slice.
  • Returns true if and only if the given offset in the given bytes falls on a valid UTF-8 encoded codepoint boundary.
  • Returns true if and only if the given byte is either a valid leading UTF-8 byte, or is otherwise an invalid byte that can never appear anywhere in a valid UTF-8 sequence.
  • Returns true if and only if the given byte is considered a word character. This only applies to ASCII.
  • len 🔒
    Given a UTF-8 leading byte, this returns the total number of code units in the following encoded codepoint.