gwyentities

gwyentities — Transform SGML-like symbol entities to UTF-8 and back.

Synopsis




typedef     GwyTextEntity;
gchar*      gwy_entities_entity_to_utf8     (const gchar *entity);
gchar*      gwy_entities_text_to_utf8       (const gchar *text);
GwyTextEntity* gwy_entities_get_entities    (void);

Description

Details

GwyTextEntity

typedef struct {
    const gchar *entity;
    const gchar *utf8;
} GwyTextEntity;

The type of text entity data.


gwy_entities_entity_to_utf8 ()

gchar*      gwy_entities_entity_to_utf8     (const gchar *entity);

Converts a single named entity entity to UTF-8 representation.

The string passed to this function should be a bare entity name, i.e. it should not contain the ampersand and semicolon.

entity: A single entity name, as a nul-delimited string.
Returns : entity if the name was not recognized, or a valid UTF-8 string. The returned string should be considered constant and never freed or modified (except when it's entity again).

gwy_entities_text_to_utf8 ()

gchar*      gwy_entities_text_to_utf8       (const gchar *text);

Converts entities in a text to UTF-8.

text: A nul-delimited string.
Returns : A newly allocated nul-delimited string containing the converted text.

gwy_entities_get_entities ()

GwyTextEntity* gwy_entities_get_entities    (void);

Returns an array of all available entities.

The array is terminated by { NULL, NULL } item. It must be treated as constant and never modified or freed.

Returns : The entities as a GwyTextEntity array.