Gio.CharsetConverter

g GObject.GInterface GObject.GInterface Gio.Converter Gio.Converter GObject.GInterface->Gio.Converter Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object Gio.CharsetConverter Gio.CharsetConverter GObject.Object->Gio.CharsetConverter Gio.Converter->Gio.CharsetConverter Gio.Initable->Gio.CharsetConverter

Subclasses

None

Methods

Inherited

GObject.Object (37), Gio.Converter (2), Gio.Initable (2)

Structs

GObject.ObjectClass (5)

class

new (to_charset, from_charset)

get_num_fallbacks ()

get_use_fallback ()

set_use_fallback (use_fallback)

Virtual Methods

Inherited

GObject.Object (7), Gio.Converter (2), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

from-charset

str

r/w/co

The character encoding to convert from

to-charset

str

r/w/co

The character encoding to convert to

use-fallback

bool

r/w/c

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

Signals

Inherited

GObject.Object (1)

Fields

Inherited

GObject.Object (1)

Class Details

class Gio.CharsetConverter(**kwargs)
Bases

GObject.Object, Gio.Converter, Gio.Initable

Abstract

No

Structure

Gio.CharsetConverterClass

Gio.CharsetConverter is an implementation of Gio.Converter based on GIConv.

classmethod new(to_charset, from_charset)[source]
Parameters
  • to_charset (str) – destination charset

  • from_charset (str) – source charset

Raises

GLib.Error

Returns

a new Gio.CharsetConverter or None on error.

Return type

Gio.CharsetConverter

Creates a new Gio.CharsetConverter.

New in version 2.24.

get_num_fallbacks()[source]
Returns

the number of fallbacks that self has applied

Return type

int

Gets the number of fallbacks that self has applied so far.

New in version 2.24.

get_use_fallback()[source]
Returns

True if fallbacks are used by self

Return type

bool

Gets the Gio.CharsetConverter :use-fallback property.

New in version 2.24.

set_use_fallback(use_fallback)[source]
Parameters

use_fallback (bool) – True to use fallbacks

Sets the Gio.CharsetConverter :use-fallback property.

New in version 2.24.

Property Details

Gio.CharsetConverter.props.from_charset
Name

from-charset

Type

str

Default Value

None

Flags

READABLE, WRITABLE, CONSTRUCT_ONLY

The character encoding to convert from

Gio.CharsetConverter.props.to_charset
Name

to-charset

Type

str

Default Value

None

Flags

READABLE, WRITABLE, CONSTRUCT_ONLY

The character encoding to convert to

Gio.CharsetConverter.props.use_fallback
Name

use-fallback

Type

bool

Default Value

False

Flags

READABLE, WRITABLE, CONSTRUCT

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