### Function

# FwupdPlugin utf8_to_utf16_bytes

#### Declaration [src]

    GBytes*
    fu_utf8_to_utf16_bytes (
      const gchar* str,
      FuEndianType endian,
      FuUtfConvertFlags flags,
      GError** error
    )

#### Description [src]

Converts UTF-8 string to a buffer of UTF-16, optionally including the trailing NULw.

Available since: | 1.9.3

#### Parameters

`str` | `const gchar*`
| A UTF-8 string.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`endian` | `FuEndianType`
| An endian type, e.g. `G_LITTLE_ENDIAN`.
`flags` | `FuUtfConvertFlags`
| No description available.
`error` | `GError **`
| The return location for a `GError*`, or `NULL`.

#### Return value

Returns: | `GBytes`
| A `GBytes`, or `NULL` on error.
| The caller of the function takes ownership of the data, and is responsible for freeing it.