GMimeFilterCharset

GMimeFilterCharset — Charset-conversion filter

Functions

Types and Values

Description

A GMimeFilter which is used for converting text from one charset to another using the native iconv backend. Complete input characters are converted immediately, growing output storage as needed. Only an incomplete input character is retained for the next call.

Completion flushes the target charset's shift state. Reset discards pending input and conversion state; copying creates a fresh converter with the same charset names, not a snapshot of a partial character.

Native conversion policy is retained: invalid or unrepresentable input bytes are skipped, and an incomplete final character is discarded. This differs from managed Encoding replacement fallbacks. Generic UTF-16/UTF-32 byte-order marks also follow iconv rather than .NET policy.

Functions

g_mime_filter_charset_new ()

GMimeFilter *
g_mime_filter_charset_new (const char *from_charset,
                           const char *to_charset);

Creates a new GMimeFilterCharset filter.

Charset names are copied and remain available through g_mime_filter_charset_get_from_charset() and g_mime_filter_charset_get_to_charset().

Parameters

from_charset

charset to convert from

 

to_charset

charset to convert to

 

Returns

a new charset filter or NULL if the charset conversion is not possible, with errno set.

[nullable][transfer full]


g_mime_filter_charset_get_from_charset ()

const char *
g_mime_filter_charset_get_from_charset
                               (GMimeFilterCharset *filter);

Gets the original source charset name supplied to the constructor. The name is not replaced with an iconv alias or a canonical MIME name.

Parameters

filter

a GMimeFilterCharset

 

Returns

the filter-owned source charset name.

[transfer none]


g_mime_filter_charset_get_to_charset ()

const char *
g_mime_filter_charset_get_to_charset (GMimeFilterCharset *filter);

Gets the original target charset name supplied to the constructor. The name is not replaced with an iconv alias or a canonical MIME name.

Parameters

filter

a GMimeFilterCharset

 

Returns

the filter-owned target charset name.

[transfer none]

Types and Values

GMimeFilterCharset

typedef struct _GMimeFilterCharset GMimeFilterCharset;

A filter to convert between charsets.