trivial-utf-8

API Reference

trivial-utf-8

TRIVIAL-UTF-8

  • Function UTF-8-BYTE-LENGTH (string)
    Calculate the amount of bytes needed to encode a string.
  • Function STRING-TO-UTF-8-BYTES (string &key null-terminate)
    Convert a string into an array of unsigned bytes containing its utf-8 representation.
  • Function WRITE-UTF-8-BYTES (string output &key null-terminate)
    Write a string to a byte-stream, encoding it as utf-8.
  • Condition UTF-8-DECODING-ERROR  (SIMPLE-ERROR)
  • Function UTF-8-GROUP-SIZE (byte)
    Determine the amount of bytes that are part of the character starting with a given byte.
  • Function UTF-8-BYTES-TO-STRING (bytes-in &key (start 0) (end (length bytes-in)))
    Convert a byte array containing utf-8 encoded characters into the string it encodes.
  • Function READ-UTF-8-STRING (input &key null-terminated stop-at-eof (char-length -1) (byte-length -1))
    Read utf-8 encoded data from a byte stream and construct a string with the characters found. When null-terminated is given it will stop reading at a null character, stop-at-eof tells it to stop at the end of file without raising an error, and the char-length and byte-length parameters can be used to specify the max amount of characters or bytes to read.