CharsetConverter

class CharsetConverter(**properties: Any)

Superclasses: Object

Implemented Interfaces: Converter, Initable

GCharsetConverter is an implementation of Converter based on IConv.

Constructors

class CharsetConverter
classmethod new(to_charset: str, from_charset: str) CharsetConverter

Creates a new CharsetConverter.

Added in version 2.24.

Parameters:
  • to_charset – destination charset

  • from_charset – source charset

Methods

class CharsetConverter
get_num_fallbacks() int

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

Added in version 2.24.

get_use_fallback() bool

Gets the CharsetConverter:use-fallback property.

Added in version 2.24.

set_use_fallback(use_fallback: bool) None

Sets the CharsetConverter:use-fallback property.

Added in version 2.24.

Parameters:

use_fallbackTrue to use fallbacks

Properties

class CharsetConverter
props.from_charset: str

The character encoding to convert from.

Added in version 2.24.

props.to_charset: str

The character encoding to convert to.

Added in version 2.24.

props.use_fallback: bool

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

Added in version 2.24.