Function

EDataServerutil_construct_data_uri

unstable since: 3.60

Declaration [src]

gchar*
e_util_construct_data_uri (
  const gchar* mime_type,
  const gchar* charset,
  gboolean is_base64,
  const gchar* data
)

Description [src]

Constructs a “data:” URI (of form “data:[mime type][;charset=charset][;base64][,]encoded_data”). The mime_type neither the charset cannot contain ‘,’ nor ‘;’,.

Available since: 3.60

Parameters

mime_type

Type: const gchar*

Optional MIME type to use, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
charset

Type: const gchar*

Optional charset to use, or NULL.

The argument can be NULL.
The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.
is_base64

Type: gboolean

TRUE, when the data is base64 encoded.

data

Type: const gchar*

Actual data.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: gchar*

A newly allocated “data:” URI constructed from the provided arguments. Free it with g_free(), when no longer needed.

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.