Package org.gnome.gtksourceview
Class Encoding
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gtksourceview.Encoding
- All Implemented Interfaces:
Proxy
Character encoding.
The GtkSourceEncoding boxed type represents a character encoding. It is used
for example by GtkSourceFile. Note that the text in GTK widgets is always
encoded in UTF-8.
-
Constructor Summary
ConstructorsConstructorDescriptionEncoding(MemorySegment address) Create a Encoding proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptioncopy()Used by language bindings.voidfree()Used by language bindings.getAll()Gets all encodings.Gets the character set of theGtkSourceEncoding, such as "UTF-8" or "ISO-8859-1".static EncodingGets theGtkSourceEncodingfor the current locale.Gets the list of default candidate encodings to try when loading a file.static @Nullable EncodinggetFromCharset(String charset) Gets aGtkSourceEncodingfrom a character set such as "UTF-8" or "ISO-8859-1".getName()Gets the name of theGtkSourceEncodingsuch as "Unicode" or "Western".static @Nullable TypegetType()Get the GType of the Encoding classstatic EncodinggetUtf8()toString()Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Encoding
Create a Encoding proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
getAll
-
getCurrent
Gets theGtkSourceEncodingfor the current locale.See also
GLib.getCharset(org.javagi.base.Out<java.lang.String>).- Returns:
- the current locale encoding.
-
getDefaultCandidates
Gets the list of default candidate encodings to try when loading a file.See
FileLoader.setCandidateEncodings(org.gnome.glib.SList<org.gnome.gtksourceview.Encoding>).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.
- Returns:
- the list of default candidate encodings. Free with g_slist_free().
-
getFromCharset
-
getUtf8
-
copy
-
free
public void free()Used by language bindings. -
getCharset
Gets the character set of theGtkSourceEncoding, such as "UTF-8" or "ISO-8859-1".- Returns:
- the character set of the
GtkSourceEncoding.
-
getName
Gets the name of theGtkSourceEncodingsuch as "Unicode" or "Western".- Returns:
- the name of the
GtkSourceEncoding.
-
toString
-