Function

GLib-2.0GLibutf8_to_utf16

  • Convert a string from UTF-8 to UTF-16.

    A nul character (U+0000) will be added to the result after the converted text.

    Parameters

    • str: string

      a UTF-8 encoded string

    • len: number

      the maximum length (number of bytes) of str to use. If len is negative, then the string is nul-terminated.

    Returns [number, number, number]

    a pointer to a newly allocated UTF-16 string. This value must be freed with GLib.free.