Function

Talkatucodeset_coerce_utf8

Declaration [src]

gchar*
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.

Parameters

data

Type: const guint8*

The raw data to coerce.

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

Type: gsize

The length of the raw data in bytes.

text_length

Type: gsize*

A return address for the length of the coerced text.

The data is owned by the caller of the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: 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.