Codeset Helpers

Codeset Helpers — Helpers for handling different codesets.

Functions

Description

Dealing with user supplied input means handling different codesets and this API helps with that.

Functions

talkatu_codeset_coerce_utf8 ()

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

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

The raw data to coerce.

 

length

The length of the raw data in bytes.

 

text_length

A return address for the length of the coerced text.

 

error

A return address for a GError if anything goes wrong.

 

Returns

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

[transfer full]

Types and Values