changeset 136:bb50648e3f02

- Added partial support for "charset" in the META element.
author jcid
date Tue, 11 Mar 2008 20:08:20 +0100
parents a82425fe3f23
children 2874325fb2a8
files ChangeLog src/html.cc
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 07 16:15:41 2008 +0100
+++ b/ChangeLog	Tue Mar 11 20:08:20 2008 +0100
@@ -75,6 +75,7 @@
  - Added a MSG_HTTP for HTTP/1.1's warning headers.
  - Added support for multi-line header fields.
  - Added support for "charset" in the HTTP header field for Content-Type.
+ - Added partial support for "charset" in the META element.
  - Added support for progressive display of progressive jpegs.
  - Fixed progressive display of interlaced pngs.
  - Enabled colspan=0 in tables parsing.
--- a/src/html.cc	Fri Mar 07 16:15:41 2008 +0100
+++ b/src/html.cc	Tue Mar 11 20:08:20 2008 +0100
@@ -3665,9 +3665,13 @@
              (content = Html_get_attr(html, tag, tagsize, "content"))) {
             char *charset = Html_get_charset(content);
             if (charset) {
+               if (!html->charset || dStrcasecmp(charset, html->charset)) {
+                  MSG("META Content-Type changes charset to: %s\n", charset);
+                  a_Decode_free(html->decoder);
+                  html->decoder = a_Decode_charset_init(charset);
+               }
                dFree(html->charset);
                html->charset = charset;
-               MSG("META Content-Type would set charset to: %s\n", charset);
             }
          }
       }