diff options
-rw-r--r-- | render/html.c | 16 | ||||
-rw-r--r-- | render/html.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/render/html.c b/render/html.c index 760df52b9..880a92a3a 100644 --- a/render/html.c +++ b/render/html.c @@ -2036,6 +2036,22 @@ const char *html_get_encoding(hlcache_handle *h) } /** + * Retrieve the charset of an HTML document + * + * \param h Content to retrieve charset from + * \return Pointer to charset, or NULL + */ +binding_encoding_source html_get_encoding_source(hlcache_handle *h) +{ + struct content *c = hlcache_handle_get_content(h); + + assert(c != NULL); + assert(c->type == CONTENT_HTML); + + return c->data.html.encoding_source; +} + +/** * Retrieve framesets used in an HTML document * * \param h Content to inspect diff --git a/render/html.h b/render/html.h index 79a3b209a..8977e6dd6 100644 --- a/render/html.h +++ b/render/html.h @@ -224,6 +224,7 @@ bool text_redraw(const char *utf8_text, size_t utf8_len, xmlDoc *html_get_document(struct hlcache_handle *h); struct box *html_get_box_tree(struct hlcache_handle *h); const char *html_get_encoding(struct hlcache_handle *h); +binding_encoding_source html_get_encoding_source(struct hlcache_handle *h); struct content_html_frames *html_get_frameset(struct hlcache_handle *h); struct content_html_iframe *html_get_iframe(struct hlcache_handle *h); const char *html_get_base_url(struct hlcache_handle *h); |