GCharsetConverter: GIO Reference Manual

## GCharsetConverter GCharsetConverter — Convert between charsets |

## Functions

GCharsetConverter * | g_charset_converter_new ()
void | g_charset_converter_set_use_fallback ()
gboolean | g_charset_converter_get_use_fallback ()
guint | g_charset_converter_get_num_fallbacks ()

## Properties

char * | from-charset | Read / Write / Construct Only
char * | to-charset | Read / Write / Construct Only
gboolean | use-fallback | Read / Write / Construct

## Types and Values

| GCharsetConverter

## Object Hierarchy

        GObject
        ╰── GCharsetConverter

## Implemented Interfaces

GCharsetConverter implements GConverter and GInitable.

## Includes

    #include <gio/gio.h>

## Description

GCharsetConverter is an implementation of GConverter based on GIConv.

## Functions

### g_charset_converter_new ()

    GCharsetConverter *
    g_charset_converter_new (const gchar *to_charset,
                             const gchar *from_charset,
                             GError **error);

Creates a new GCharsetConverter.

#### Parameters

to_charset | destination charset |
from_charset | source charset |
error | GError for error reporting, or `NULL` to ignore. |

#### Returns

a new GCharsetConverter or `NULL` on error.

Since: 2.24

### g_charset_converter_set_use_fallback ()

    void
    g_charset_converter_set_use_fallback (GCharsetConverter *converter,
                                          gboolean use_fallback);

Sets the “use-fallback” property.

#### Parameters

converter | a GCharsetConverter |
use_fallback | `TRUE` to use fallbacks |

Since: 2.24

### g_charset_converter_get_use_fallback ()

    gboolean
    g_charset_converter_get_use_fallback (GCharsetConverter *converter);

Gets the “use-fallback” property.

#### Parameters

converter | a GCharsetConverter |

#### Returns

`TRUE` if fallbacks are used by `converter`

Since: 2.24

### g_charset_converter_get_num_fallbacks ()

    guint
    g_charset_converter_get_num_fallbacks (GCharsetConverter *converter);

Gets the number of fallbacks that `converter` has applied so far.

#### Parameters

converter | a GCharsetConverter |

#### Returns

the number of fallbacks that `converter` has applied

Since: 2.24

## Types and Values

### GCharsetConverter

    typedef struct _GCharsetConverter GCharsetConverter;

Conversions between character sets.

## Property Details

### The `“from-charset”` property

      “from-charset”             char *

The character encoding to convert from.

Owner: GCharsetConverter

Flags: Read / Write / Construct Only

Default value: NULL

### The `“to-charset”` property

      “to-charset”               char *

The character encoding to convert to.

Owner: GCharsetConverter

Flags: Read / Write / Construct Only

Default value: NULL

### The `“use-fallback”` property

      “use-fallback”             gboolean

Use fallback (of form \<hexval>) for invalid bytes.

Owner: GCharsetConverter

Flags: Read / Write / Construct

Default value: FALSE