:right-sidebar: True CharsetConverter =================================================================== .. currentmodule:: gi.repository.Gio .. class:: CharsetConverter(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gio.Converter`, :class:`~gi.repository.Gio.Initable` :Constructors: :: CharsetConverter(**properties) new(to_charset:str, from_charset:str) -> Gio.CharsetConverter Constructors ------------ .. rst-class:: interim-class .. class:: CharsetConverter :no-index: .. classmethod:: new(to_charset: str, from_charset: str) -> ~gi.repository.Gio.CharsetConverter Creates a new :obj:`~gi.repository.Gio.CharsetConverter`. .. versionadded:: 2.24 :param to_charset: destination charset :param from_charset: source charset Methods ------- .. rst-class:: interim-class .. class:: CharsetConverter :no-index: .. method:: get_num_fallbacks() -> int Gets the number of fallbacks that ``converter`` has applied so far. .. versionadded:: 2.24 .. method:: get_use_fallback() -> bool Gets the :obj:`~gi.repository.Gio.CharsetConverter`:use-fallback property. .. versionadded:: 2.24 .. method:: set_use_fallback(use_fallback: bool) -> None Sets the :obj:`~gi.repository.Gio.CharsetConverter`:use-fallback property. .. versionadded:: 2.24 :param use_fallback: :const:`True` to use fallbacks Properties ---------- .. rst-class:: interim-class .. class:: CharsetConverter :no-index: .. attribute:: props.from_charset :type: str The character encoding to convert from. .. versionadded:: 2.24 .. attribute:: props.to_charset :type: str The character encoding to convert to. .. versionadded:: 2.24 .. attribute:: props.use_fallback :type: bool Use fallback (of form ``\``) for invalid bytes. .. versionadded:: 2.24