kaven-basic - v6.0.0
    Preparing search index...

    Function UTF8Encode

    • Encodes a given string into its UTF-8 byte representation and returns a string where each character corresponds to a byte of the UTF-8 encoding.

      Parameters

      • str: string

        The input string to encode.

      Returns string

      A string where each character represents a byte of the UTF-8 encoded input.

      This function is useful for scenarios where you need a string representation of the UTF-8 bytes of the original string, such as for binary-safe storage or transmission.

      const encoded = UTF8Encode("hello");
      // encoded will be a string of characters representing the UTF-8 bytes of "hello"

      4.0.0

      2021-12-14