diff options
author | Dai Sato <satodai@w3m.jp> | 2012-05-22 09:45:56 +0000 |
---|---|---|
committer | Dai Sato <satodai@w3m.jp> | 2012-05-22 09:45:56 +0000 |
commit | e7fe8d004d4cac5ae469fb2cd9ba16332d58a456 (patch) | |
tree | a69de9fbcc49a57887e6b402f1abca98b6364fe3 /file.c | |
parent | correction: 0.5.2 -> 0.5.3 (diff) | |
download | w3m-e7fe8d004d4cac5ae469fb2cd9ba16332d58a456.tar.gz w3m-e7fe8d004d4cac5ae469fb2cd9ba16332d58a456.zip |
parse META CHARSET
Diffstat (limited to '')
-rw-r--r-- | file.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.265 2010/12/15 10:50:24 htrb Exp $ */ +/* $Id: file.c,v 1.266 2012/05/22 09:45:56 inu Exp $ */ #include "fm.h" #include <sys/types.h> #include "myctype.h" @@ -5020,10 +5020,17 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env) HTMLlineproc1(tmp->ptr, h_env); return 1; case HTML_META: - p = q = NULL; + p = q = r = NULL; parsedtag_get_value(tag, ATTR_HTTP_EQUIV, &p); parsedtag_get_value(tag, ATTR_CONTENT, &q); #ifdef USE_M17N + parsedtag_get_value(tag, ATTR_CHARSET, &r); + if (r) { + /* <meta charset=""> */ + SKIP_BLANKS(r); + meta_charset = wc_guess_charset(r, 0); + } + else if (p && q && !strcasecmp(p, "Content-Type") && (q = strcasestr(q, "charset")) != NULL) { q += 7; |