/*
- * Copyright (C) 2005-2008 Atsushi Konno All rights reserved.
+ * Copyright (C) 2005-2009 Atsushi Konno All rights reserved.
* Copyright (C) 2005 QSDN,Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
}
+char *
+chxj_jhtml_emoji_only_converter(request_rec *r, const char *src, apr_size_t len)
+{
+ apr_size_t ii;
+ Doc doc;
+ jhtml_t __jhtml;
+ jhtml_t *jhtml;
+ char one_byte[2];
+ char two_byte[3];
+ apr_pool_t *pool;
+
+ jhtml = &__jhtml;
+
+ DBG(r, "REQ[%X] start chxj_jhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
+ memset(doc, 0, sizeof(Doc));
+ memset(jhtml, 0, sizeof(jhtml_t));
+
+ doc->r = r;
+ jhtml->doc = doc;
+ jhtml->spec = spec;
+ jhtml->out = qs_alloc_zero_byte_string(r->pool);
+ jhtml->conf = chxj_get_module_config(r->per_dir_config, &chxj_module);
+ jhtml->doc->parse_mode = PARSE_MODE_CHTML;
+
+ apr_pool_create(&pool, r->pool);
+
+ chxj_buffered_write_init(pool, &doc.buf);
+
+ for (ii=0; ii<len; ii++) {
+ char *out;
+ int rtn;
+
+ rtn = s_jhtml_search_emoji(jhtml, &src[ii], &out);
+ if (rtn) {
+ W_V(out);
+ ii+=(rtn - 1);
+ continue;
+ }
+
+ if (is_sjis_kanji(src[ii])) {
+ two_byte[0] = src[ii+0];
+ two_byte[1] = src[ii+1];
+ two_byte[2] = 0;
+ W_V(two_byte);
+ ii++;
+ }
+ else {
+ one_byte[0] = src[ii+0];
+ one_Byte[1] = 0;
+ W_V(one_byte);
+ }
+ }
+
+ DBG(r, "REQ[%X] end chxj_jhtml_emoji_eonly_converter()", (apr_size_t)(unsigned int)r);
+ return jhtml->out;
+}
+
+
/**
* It is a handler who processes the HTML tag.
*
value = chxj_encoding_parameter(r, value);
if (! chxj_starts_with(value, "mailto:") && ! chxj_starts_with(value, "tel:")) {
value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
- value = chxj_jreserved_tag_to_safe_for_query_string(r, value);
+ value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
}
W_L(" href=\"");
W_V(value);
W_L("<form");
if (attr_action) {
char *q;
- char *unused = NULL;
+ char *old_qs = NULL;
q = strchr(attr_action, '?');
if (q) {
- new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &unused, CHXJ_FALSE, CHXJ_TRUE);
- if (new_hidden_tag) {
+ new_hidden_tag = chxj_form_action_to_hidden_tag(r, doc->pool, attr_action, 0, post_flag, &old_qs, CHXJ_FALSE, CHXJ_TRUE, jhtml->entryp);
+ if (new_hidden_tag || old_qs) {
*q = 0;
}
}
W_L(" action=\"");
W_V(attr_action);
+ if (old_qs) {
+ W_L("?");
+ W_V(old_qs);
+ }
W_L("\"");
}
if (attr_method) {
}
if (name && *name) {
W_L(" name=\"");
- W_V(chxj_jreserved_to_safe_tag(r, name));
+ W_V(chxj_jreserved_to_safe_tag(r, name, jhtml->entryp));
W_L("\"");
}
if (value && *value) {
/*----------------------------------------------------------------------*/
#ifdef IMG_NOT_CONVERT_FILENAME
value = chxj_encoding_parameter(r, value);
- value = chxj_jreserved_tag_to_safe_for_query_string(r, value);
+ value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
value = chxj_add_cookie_no_update_parameter(r, value);
W_L(" src=\"");
#else
value = chxj_img_conv(r, spec, value);
value = chxj_encoding_parameter(r, value);
- value = chxj_jreserved_tag_to_safe_for_query_string(r, value);
+ value = chxj_jreserved_tag_to_safe_for_query_string(r, value, jhtml->entryp);
value = chxj_add_cookie_parameter(r, value, jhtml->cookie);
value = chxj_add_cookie_no_update_parameter(r, value);
W_L(" src=\"");