Tepl.EncodingIconv¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Details¶
- class Tepl.EncodingIconv¶
- classmethod get_all()¶
- Returns:
a list of
Tepl.EncodingIconv
's.- Return type:
Gets a list of all encodings known by
Tepl.EncodingIconv
.New in version 6.4.
- classmethod get_default_candidates()¶
- Returns:
the list of default candidate encodings.
- Return type:
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.
Note that the returned list doesn’t contain all encodings known by
Tepl.EncodingIconv
, it is a limited list that contains only the encodings that have the most likelihood to fit for the current locale.New in version 6.4.
- equals(enc2)¶
- Parameters:
enc2 (
Tepl.EncodingIconv
orNone
) – aTepl.EncodingIconv
, orNone
.- Returns:
whether self and enc2 are equal.
- Return type:
Returns whether self and enc2 are equal. It returns
True
iff:Both self and enc2 are
None
;Or both self and enc2 have a UTF-8 charset (see
Tepl.EncodingIconv.is_utf8
());Or the charsets are equal according to
GLib.ascii_strcasecmp
() (because iconv-compatible charsets are case insensitive).
New in version 6.4.
- free()¶
New in version 6.4.
- is_utf8()¶
- Returns:
whether self is a UTF-8 encoding.
- Return type:
Returns whether self is a UTF-8 encoding.
If self was created with tepl_encoding_iconv_new_utf8(), the charset is “UTF-8”. But iconv supports other variants: “UTF8”, “utf-8” and “utf8”. This function returns
True
for all UTF-8 variants supported by iconv.New in version 6.4.
- to_base_type()¶
- Returns:
the
Tepl.Encoding
object of self.- Return type:
New in version 6.4.
- to_string()¶
-
Returns the encoding category name with the charset in parenthesis, for example “Unicode (UTF-8)”. If the category name is unknown, just the charset is returned.
The category name is localized (i.e., already translated).
New in version 6.4.