Skip to main content

Text.from_utf_8

Text.from_utf_8byteson_problems

Documentation

Takes a vector of bytes and returns Text resulting from decoding it as UTF-8.

This is useful for low-level operations, such as binary data encoding and decoding.

Arguments

  • bytes: The vector of UTF-8 bytes.
  • on_problems: Specifies the behavior when a problem occurs during the function. By default, a dataflow error is raised.

Examples

Decoding the bytes to get a text.

      Text.from_utf_8 [-32, -92, -107, -32, -91, -115, -32, -92, -73, -32, -92, -65]