Skip to main content

Text.bytes

bytesencoding on_problems

Documentation

Returns a vector containing bytes representing the specified encoding of the input text. This is useful for low-level operations, such as binary data encoding.

Arguments

  • encoding: The text encoding to encode self with. Defaults to UTF-8.
  • on_problems: Specifies the behavior when a problem occurs during the function. By default, a warning is issued, but the operation proceeds. If set to Report_Error, the operation fails with a dataflow error. If set to Ignore, the operation proceeds without errors or warnings.

Examples

Get the ASCII bytes of the text "Hello".

      "Hello".bytes (Encoding.ascii)