Function

FwupdPluginutf8_to_utf16_byte_array

Declaration [src]

GByteArray*
fu_utf8_to_utf16_byte_array (
  const gchar* str,
  FuEndianType endian,
  FuUtfConvertFlags flags,
  GError** error
)

Description [src]

Converts UTF-8 string to a buffer of UTF-16, optionially 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
 

A FuUtfConvertFlags, e.g. FU_UTF_CONVERT_FLAG_APPEND_NUL.

error GError **
  The return location for a GError*, or NULL.

Return value

Returns: An array of guint8
 

A GByteArray, or NULL on error.

 The caller of the function takes ownership of the data, and is responsible for freeing it.