HTML text utilities

HTML text utilities — UTF-8 HTML text and attribute encoding and decoding

Functions

Description

Encoding escapes markup characters, drops disallowed controls and emits non-ASCII characters as decimal numeric references. Attribute encoding includes the enclosing quote characters. Decoding recognizes the complete HTML named-reference table and numeric replacement rules.

Functions

g_mime_html_encode ()

char *
g_mime_html_encode (const char *text);

Parameters

text

UTF-8 text

 

Returns

newly allocated HTML-encoded text.

[transfer full]


g_mime_html_attribute_encode ()

char *
g_mime_html_attribute_encode (const char *text);

Parameters

text

a UTF-8 attribute value

 

Returns

newly allocated encoded text, including double quotes.

[transfer full]


g_mime_html_attribute_encode_quoted ()

char *
g_mime_html_attribute_encode_quoted (const char *text,
                                     char quote);

Parameters

text

a UTF-8 attribute value

 

quote

the single or double quote to use

 

Returns

newly allocated encoded text, including quotes.

[transfer full]


g_mime_html_decode ()

char *
g_mime_html_decode (const char *text);

Parameters

text

UTF-8 text containing character references

 

Returns

newly allocated decoded text.

[transfer full]


g_mime_html_attribute_decode ()

char *
g_mime_html_attribute_decode (const char *text);

Parameters

text

a UTF-8 attribute value containing character references

 

Returns

newly allocated text decoded using attribute rules.

[transfer full]