From 4ba99ea5f0b068478d70f0a6bc97114e2e29f019 Mon Sep 17 00:00:00 2001 From: konn Date: Thu, 14 Feb 2008 08:44:10 +0000 Subject: [PATCH] * Added test for meta tag. * Added meta tag convert routine. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@1848 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- sample_site/1.php | 1 + src/chxj_jhtml.c | 35 +++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/sample_site/1.php b/sample_site/1.php index 124ba3b0..7c008d1e 100644 --- a/sample_site/1.php +++ b/sample_site/1.php @@ -5,6 +5,7 @@ header("Pragma: no-cache"); ?> + mod_chxjŽÃŽ½ŽÄŽ»Ž²ŽÄ diff --git a/src/chxj_jhtml.c b/src/chxj_jhtml.c index 1e5efc73..cd33e3e9 100644 --- a/src/chxj_jhtml.c +++ b/src/chxj_jhtml.c @@ -543,13 +543,12 @@ s_jhtml_start_meta_tag(void *pdoc, Node *node) value, "\"", NULL); - if ((*value == 'c' || *value == 'C') - && strcasecmp(value, "content-type") == 0) { + if (STRCASEEQ('c','C',"content-type", value)) { content_type_flag = 1; } - if ((*value == 'r' || *value == 'R') - && strcasecmp(value, "refresh") == 0) + if (STRCASEEQ('r','R',"refresh", value)) { refresh_flag = 1; + } } break; @@ -560,14 +559,26 @@ s_jhtml_start_meta_tag(void *pdoc, Node *node) /* CHTML 2.0 */ /*----------------------------------------------------------------------*/ if (content_type_flag) { - jhtml->out = apr_pstrcat(r->pool, - jhtml->out, - " ", - name, - "=\"", - "text/html; charset=Windows-31J", - "\"", - NULL); + if (IS_SJIS_STRING(GET_SPEC_CHARSET(jhtml->spec))) { + jhtml->out = apr_pstrcat(r->pool, + jhtml->out, + " ", + name, + "=\"", + "text/html; charset=Windows-31J", + "\"", + NULL); + } + else { + jhtml->out = apr_pstrcat(r->pool, + jhtml->out, + " ", + name, + "=\"", + "text/html; charset=UTF-8", + "\"", + NULL); + } } else if (refresh_flag) { -- 2.11.0