GtkSource.Encoding

Fields

None

Methods

class

get_all ()

class

get_current ()

class

get_default_candidates ()

class

get_from_charset (charset)

class

get_utf8 ()

copy ()

free ()

get_charset ()

get_name ()

to_string ()

Details

class GtkSource.Encoding
classmethod get_all()
Returns:

a list of all GtkSource.Encoding's. Free with g_slist_free().

Return type:

[GtkSource.Encoding]

Gets all encodings.

New in version 3.14.

classmethod get_current()
Returns:

the current locale encoding.

Return type:

GtkSource.Encoding

Gets the GtkSource.Encoding for the current locale. See also GLib.get_charset().

New in version 3.14.

classmethod get_default_candidates()
Returns:

the list of default candidate encodings. Free with g_slist_free().

Return type:

[GtkSource.Encoding]

Gets the list of default candidate encodings to try when loading a file. See GtkSource.FileLoader.set_candidate_encodings().

This function returns a different list depending on the current locale (i.e. language, country and default encoding). The UTF-8 encoding and the current locale encoding are guaranteed to be present in the returned list.

New in version 3.18.

classmethod get_from_charset(charset)
Parameters:

charset (str) – a character set.

Returns:

the corresponding GtkSource.Encoding, or None if not found.

Return type:

GtkSource.Encoding or None

Gets a GtkSource.Encoding from a character set such as “UTF-8” or “ISO-8859-1”.

New in version 3.14.

classmethod get_utf8()
Returns:

the UTF-8 encoding.

Return type:

GtkSource.Encoding

New in version 3.14.

copy()
Returns:

a copy of self.

Return type:

GtkSource.Encoding

Used by language bindings.

New in version 3.14.

free()

Used by language bindings.

New in version 3.14.

get_charset()
Returns:

the character set of the GtkSource.Encoding.

Return type:

str

Gets the character set of the GtkSource.Encoding, such as “UTF-8” or “ISO-8859-1”.

New in version 3.14.

get_name()
Returns:

the name of the GtkSource.Encoding.

Return type:

str

Gets the name of the GtkSource.Encoding such as “Unicode” or “Western”.

New in version 3.14.

to_string()
Returns:

a string representation. Free with GLib.free() when no longer needed.

Return type:

str

New in version 3.14.