Declaration [src]

talkatu_codeset_coerce_utf8 (
  const guint8* data,
  gsize length,
  gsize* text_length,
  GError** error

Description [src]

Attempts to coerce the raw data into UTF-8.

Currently it handles UTF-8, UTF-16 (host encoding), UTF-16 littled endian, and UTF-16 big endian.


data const guint8*

The raw data to coerce.

 The data is owned by the caller of the function.
length gsize

The length of the raw data in bytes.

text_length gsize*

A return address for the length of the coerced text.

 The data is owned by the caller of the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gchar*

The coerced data as UTF-8, or NULL with error set on error.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The value is a NUL terminated UTF-8 string.