diff options
author | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:23:02 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@vega.ocn.ne.jp> | 2011-05-04 07:23:02 +0000 |
commit | 6db339b3d7a391f196e7c4b725a4ed0bd00f31cf (patch) | |
tree | 7d6fed976b72694d61fc595a745d394e1cd6e1a5 /w3mbookmark.c | |
parent | Adding upstream version 0.5.1 (diff) | |
download | w3m-6db339b3d7a391f196e7c4b725a4ed0bd00f31cf.tar.gz w3m-6db339b3d7a391f196e7c4b725a4ed0bd00f31cf.zip |
Adding upstream version 0.5.2upstream/0.5.2
Diffstat (limited to '')
-rw-r--r-- | w3mbookmark.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/w3mbookmark.c b/w3mbookmark.c index 74d7203..4355536 100644 --- a/w3mbookmark.c +++ b/w3mbookmark.c @@ -1,4 +1,4 @@ -/* $Id: w3mbookmark.c,v 1.10 2003/09/23 18:42:25 ukai Exp $ */ +/* $Id: w3mbookmark.c,v 1.12 2007/05/31 01:19:50 inu Exp $ */ #include <stdlib.h> #include <stdio.h> #include "config.h" @@ -52,18 +52,18 @@ static char end_section[] = static char *Local_cookie = NULL; void -print_bookmark_panel(char *bmark, char *url, char *title) +print_bookmark_panel(char *bmark, char *url, char *title, char *charset) { Str tmp, tmp2; FILE *f; char *p; -#if LANG == JA - /* FIXME: gettextize here */ - printf("Content-Type: text/html; charset=EUC-JP\n\n"); -#else - printf("Content-Type: text/html\n\n"); -#endif + if (charset == NULL) { + printf("Content-Type: text/html\n\n"); + } + else { + printf("Content-Type: text/html; charset=%s\n\n", charset); + } printf(bkmark_src1, html_quote(bmark), html_quote(Local_cookie)); if ((f = fopen(bmark, "r")) != NULL) { printf("<tr><td>Section:<td><select name=\"section\">\n"); @@ -188,8 +188,10 @@ main(int argc, char *argv[], char **envp) char *bmark; char *url; char *title; + char *charset; char *sent_cookie; + GC_INIT(); p = getenv("REQUEST_METHOD"); if (p == NULL || strcasecmp(p, "post")) goto request_err; @@ -224,12 +226,13 @@ main(int argc, char *argv[], char **envp) bmark = expandPath(tag_get_value(cgiarg, "bmark")); url = tag_get_value(cgiarg, "url"); title = tag_get_value(cgiarg, "title"); + charset = tag_get_value(cgiarg, "charset"); if (bmark == NULL || url == NULL) goto request_err; if (mode && !strcmp(mode, "panel")) { if (title == NULL) title = ""; - print_bookmark_panel(bmark, url, title); + print_bookmark_panel(bmark, url, title, charset); } else if (mode && !strcmp(mode, "register")) { printf("Content-Type: text/plain\n"); |