GtkSourceEncoding

GtkSourceEncoding — Character encoding

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── GtkSourceEncoding

Includes

#include <gtksourceview/gtksource.h>

Description

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.

Functions

GtkSourceEncodingForeachFunc ()

void
(*GtkSourceEncodingForeachFunc) (const GtkSourceEncoding *encoding,
                                 gpointer userdata);

Specifies the type of function passed to gtk_source_encoding_foreach(). The function is called with each encoding, together with the user data passed to gtk_source_encoding_foreach().

Parameters

encoding

a GtkSourceEncoding.

 

userdata

user data.

 

Since 3.14


gtk_source_encoding_get_utf8 ()

const GtkSourceEncoding *
gtk_source_encoding_get_utf8 (void);

Returns

the UTF-8 encoding.

Since 3.14


gtk_source_encoding_get_current ()

const GtkSourceEncoding *
gtk_source_encoding_get_current (void);

Gets the GtkSourceEncoding for the current locale. See also g_get_charset().

Returns

the current locale encoding.

Since 3.14


gtk_source_encoding_get_from_charset ()

const GtkSourceEncoding *
gtk_source_encoding_get_from_charset (const gchar *charset);

Gets a GtkSourceEncoding from a character set such as "UTF-8" or "ISO-8859-1".

Parameters

charset

a character set.

 

Returns

the corresponding GtkSourceEncoding, or NULL if not found.

Since 3.14


gtk_source_encoding_to_string ()

gchar *
gtk_source_encoding_to_string (const GtkSourceEncoding *enc);

Parameters

enc

a GtkSourceEncoding.

 

Returns

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

Since 3.14


gtk_source_encoding_get_name ()

const gchar *
gtk_source_encoding_get_name (const GtkSourceEncoding *enc);

Gets the name of the GtkSourceEncoding such as "Unicode" or "Western".

Parameters

enc

a GtkSourceEncoding.

 

Returns

the name of the GtkSourceEncoding.

Since 3.14


gtk_source_encoding_get_charset ()

const gchar *
gtk_source_encoding_get_charset (const GtkSourceEncoding *enc);

Gets the character set of the GtkSourceEncoding, such as "UTF-8" or "ISO-8859-1".

Parameters

enc

a GtkSourceEncoding.

 

Returns

the character set of the GtkSourceEncoding.

Since 3.14


gtk_source_encoding_foreach ()

void
gtk_source_encoding_foreach (GtkSourceEncodingForeachFunc func,
                             gpointer user_data);

Calls a function for each encoding.

Parameters

func

the function to call for each encoding.

[scope call]

user_data

user data to pass to the function

 

Since 3.14


gtk_source_encoding_copy ()

GtkSourceEncoding *
gtk_source_encoding_copy (const GtkSourceEncoding *enc);

Used by language bindings.

Parameters

enc

a GtkSourceEncoding.

 

Returns

a copy of enc .

Since 3.14


gtk_source_encoding_free ()

void
gtk_source_encoding_free (GtkSourceEncoding *enc);

Used by language bindings.

Parameters

enc

a GtkSourceEncoding.

 

Since 3.14

Types and Values

GtkSourceEncoding

typedef struct _GtkSourceEncoding GtkSourceEncoding;

See Also

GtkSourceFileSaver, GtkSourceFileLoader