diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2006-12-28 00:42:14 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2006-12-28 00:42:14 +0000 |
commit | 98b451ffaeedf9f5b0d4ab249c9f8eb216988eb1 (patch) | |
tree | 867e939cb3fd62d4c767f22ee728b225b89ace26 | |
parent | abcce3dfe7c372b0b81ac747d7c40e2325c52d11 (diff) | |
download | netsurf-98b451ffaeedf9f5b0d4ab249c9f8eb216988eb1.tar.gz netsurf-98b451ffaeedf9f5b0d4ab249c9f8eb216988eb1.tar.bz2 |
Add option to set Accept-Charset header (Stefaan Claes)
svn path=/trunk/netsurf/; revision=3124
-rw-r--r-- | content/fetch.c | 8 | ||||
-rw-r--r-- | desktop/options.c | 3 | ||||
-rw-r--r-- | desktop/options.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/content/fetch.c b/content/fetch.c index b4eec2d06..7fb082f02 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -431,6 +431,14 @@ struct fetch * fetch_start(char *url, char *referer, APPEND(fetch->headers, s); } + if (option_accept_charset) { + char s[80]; + snprintf(s, sizeof s, "Accept-Charset: %s, *;q=0.1", + option_accept_charset); + s[sizeof s - 1] = 0; + APPEND(fetch->headers, s); + } + /* And add any headers specified by the caller */ for (i = 0; headers[i]; i++) { if (strncasecmp(headers[i], "If-Modified-Since:", 18) == 0) { diff --git a/desktop/options.c b/desktop/options.c index aa0876f8e..3875a1d73 100644 --- a/desktop/options.c +++ b/desktop/options.c @@ -67,6 +67,8 @@ char *option_font_cursive; char *option_font_fantasy; /** Accept-Language header. */ char *option_accept_language = 0; +/** Accept-Charset header. */ +char *option_accept_charset = 0; /** Preferred maximum size of memory cache / bytes. */ int option_memory_cache_size = 2 * 1024 * 1024; /** Preferred expiry age of disc cache / days. */ @@ -149,6 +151,7 @@ struct { { "font_cursive", OPTION_STRING, &option_font_cursive }, { "font_fantasy", OPTION_STRING, &option_font_fantasy }, { "accept_language", OPTION_STRING, &option_accept_language }, + { "accept_charset", OPTION_STRING, &option_accept_charset }, { "memory_cache_size", OPTION_INTEGER, &option_memory_cache_size }, { "disc_cache_age", OPTION_INTEGER, &option_disc_cache_age }, { "block_advertisements", OPTION_BOOL, &option_block_ads }, diff --git a/desktop/options.h b/desktop/options.h index 47f36d91e..a394204ec 100644 --- a/desktop/options.h +++ b/desktop/options.h @@ -40,6 +40,7 @@ extern char *option_http_proxy_auth_pass; extern int option_font_size; extern int option_font_min_size; extern char *option_accept_language; +extern char *option_accept_charset; extern int option_memory_cache_size; extern int option_disc_cache_age; extern bool option_block_ads; |