Author: jmb
Date: Thu Dec 28 00:42:14 2006
New Revision: 3124
URL:
http://svn.semichrome.net?rev=3124&view=rev
Log:
Add option to set Accept-Charset header (Stefaan Claes)
Modified:
trunk/netsurf/content/fetch.c
trunk/netsurf/desktop/options.c
trunk/netsurf/desktop/options.h
Modified: trunk/netsurf/content/fetch.c
URL:
http://svn.semichrome.net/trunk/netsurf/content/fetch.c?rev=3124&r1=3...
==============================================================================
--- trunk/netsurf/content/fetch.c (original)
+++ trunk/netsurf/content/fetch.c Thu Dec 28 00:42:14 2006
@@ -431,6 +431,14 @@
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) {
Modified: trunk/netsurf/desktop/options.c
URL:
http://svn.semichrome.net/trunk/netsurf/desktop/options.c?rev=3124&r1...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Thu Dec 28 00:42:14 2006
@@ -67,6 +67,8 @@
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 @@
{ "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 },
Modified: trunk/netsurf/desktop/options.h
URL:
http://svn.semichrome.net/trunk/netsurf/desktop/options.h?rev=3124&r1...
==============================================================================
--- trunk/netsurf/desktop/options.h (original)
+++ trunk/netsurf/desktop/options.h Thu Dec 28 00:42:14 2006
@@ -40,6 +40,7 @@
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;