* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "mod_chxj.h"
#include "chxj_chtml20.h"
#include "chxj_hdml.h"
#include "chxj_str_util.h"
static char *s_chtml20_text_tag(void *pdoc, Node *node);
+
tag_handler chtml20_handler[] = {
/* tagHTML */
{
"\"",
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;
case 'C':
if (strcasecmp(name, "content") == 0) {
if (content_type_flag) {
- chtml20->out = apr_pstrcat(r->pool,
- chtml20->out,
- " ",
- name,
- "=\"",
- "text/html; charset=Windows-31J",
- "\"",
- NULL);
+ if (IS_SJIS_STRING(GET_SPEC_CHARSET(chtml20->spec))) {
+ chtml20->out = apr_pstrcat(r->pool,
+ chtml20->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=Windows-31J",
+ "\"",
+ NULL);
+ }
+ else {
+ chtml20->out = apr_pstrcat(r->pool,
+ chtml20->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=UTF-8",
+ "\"",
+ NULL);
+ }
}
- else
- if (refresh_flag) {
+ else if (refresh_flag) {
char* buf = apr_pstrdup(r->pool, value);
char* sec;
char* url;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "mod_chxj.h"
#include "chxj_chtml30.h"
#include "chxj_hdml.h"
#include "chxj_str_util.h"
"\"",
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;
case 'C':
if (strcasecmp(name, "content") == 0) {
if (content_type_flag) {
- chtml30->out = apr_pstrcat(r->pool,
- chtml30->out,
- " ",
- name,
- "=\"",
- "text/html; charset=Windows-31J",
- "\"",
- NULL);
+ if (IS_SJIS_STRING(GET_SPEC_CHARSET(chtml30->spec))) {
+ chtml30->out = apr_pstrcat(r->pool,
+ chtml30->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=Windows-31J",
+ "\"",
+ NULL);
+ }
+ else {
+ chtml30->out = apr_pstrcat(r->pool,
+ chtml30->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=UTF-8",
+ "\"",
+ NULL);
+ }
}
else
if (refresh_flag) {
attr = qs_get_next_attr(doc,attr)) {
char *name = qs_get_attr_name(doc,attr);
char *value = qs_get_attr_value(doc,attr);
- if (strcasecmp(name, "name") == 0) {
+ if (STRCASEEQ('n','N', "name", name)) {
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
"\"",
NULL);
}
- else
- if (strcasecmp(name, "http-equiv") == 0) {
+ else if (STRCASEEQ('h','H',"http-equiv", name)) {
xhtml->out = apr_pstrcat(r->pool,
xhtml->out,
" ",
value,
"\"",
NULL);
- if ((*value == 'c' || *value == 'C') && strcasecmp(value, "content-type") == 0) {
+ if (STRCASEEQ('c','C',"content-type", value)) {
content_type_flag = 1;
}
}
- else
- if (strcasecmp(name, "content") == 0) {
+ else if (STRCASEEQ('c','C',"content", name)) {
if (content_type_flag) {
- xhtml->out = apr_pstrcat(r->pool,
- xhtml->out,
- " ",
- name,
- "=\"",
- "text/html; charset=Windows-31J",
- "\"",
- NULL);
+ if (IS_SJIS_STRING(GET_SPEC_CHARSET(xhtml->spec))) {
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=Windows-31J",
+ "\"",
+ NULL);
+ }
+ else {
+ xhtml->out = apr_pstrcat(r->pool,
+ xhtml->out,
+ " ",
+ name,
+ "=\"",
+ "text/html; charset=UTF-8",
+ "\"",
+ NULL);
+ }
}
else {
xhtml->out = apr_pstrcat(r->pool,