+++ /dev/null
-applied in icinga :)
-https://git.icinga.org/?p=icinga-core.git;a=commit;h=82c07167e482d0936f18f2763a342b78af0b618e
-https://dev.icinga.org/issues/1002
-
-but not in nagios :(
-http://tracker.nagios.org/view.php?id=182
-
---- nagios/common/shared.c~ 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/common/shared.c 2013-10-01 22:02:51.624429871 +0200
-@@ -9,6 +9,7 @@
- */
- int date_format;
- int interval_length;
-+char *http_charset = NULL;
- char *illegal_output_chars;
- char illegal_output_char_map[] = CHAR_MAP_INIT(0);
- time_t program_start = 0L;
-diff -ur nagios.org/cgi/avail.c nagios/cgi/avail.c
---- nagios.org/cgi/avail.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/avail.c 2013-10-01 21:49:29.426623753 +0200
-@@ -1033,9 +1033,9 @@
- printf("Expires: %s\r\n", date_time);
-
- if(output_format == HTML_OUTPUT)
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
- else {
-- printf("Content-type: text/csv\r\n\r\n");
-+ printf("Content-type: text/csv; charset=\"%s\"\r\n\r\n", http_charset);
- return;
- }
-
-diff -ur nagios.org/cgi/cgiutils.c nagios/cgi/cgiutils.c
---- nagios.org/cgi/cgiutils.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/cgiutils.c 2013-10-01 21:49:29.429957215 +0200
-@@ -169,6 +169,9 @@
- host_unreachable_sound = NULL;
- normal_sound = NULL;
-
-+ my_free(http_charset);
-+ http_charset = strdup(DEFAULT_HTTP_CHARSET);
-+
- statusmap_background_image = NULL;
- color_transparency_index_r = 255;
- color_transparency_index_g = 255;
-@@ -391,6 +394,9 @@
- else if(!strcmp(var, "illegal_macro_output_chars"))
- illegal_output_chars = strdup(val);
-
-+ else if(!strcmp(var, "http_charset"))
-+ http_charset = strdup(val);
-+
- else if(!strcmp(var, "notes_url_target"))
- notes_url_target = strdup(val);
-
-diff -ur nagios.org/cgi/cmd.c nagios/cgi/cmd.c
---- nagios.org/cgi/cmd.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/cmd.c 2013-10-01 21:49:29.429957215 +0200
-@@ -38,6 +38,8 @@
-
- extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
-
-+extern char *http_charset;
-+
- extern int nagios_process_state;
-
- extern int use_authentication;
-@@ -242,7 +244,7 @@
-
- if(content_type == WML_CONTENT) {
-
-- printf("Content-type: text/vnd.wap.wml\r\n\r\n");
-+ printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset);
-
- printf("<?xml version=\"1.0\"?>\n");
- printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");
-@@ -254,7 +256,7 @@
-
- else {
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- printf("<html>\n");
- printf("<head>\n");
-diff -ur nagios.org/cgi/config.c nagios/cgi/config.c
---- nagios.org/cgi/config.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/config.c 2013-10-01 21:49:29.433290641 +0200
-@@ -291,7 +291,7 @@
- printf("Pragma: no-cache\r\n");
- printf("Last-Modified: %s\r\n", date_time);
- printf("Expires: %s\r\n", date_time);
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- printf("<html>\n");
- printf("<head>\n");
-diff -ur nagios.org/cgi/extinfo.c nagios/cgi/extinfo.c
---- nagios.org/cgi/extinfo.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/extinfo.c 2013-10-01 21:49:29.433290641 +0200
-@@ -537,7 +537,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/histogram.c nagios/cgi/histogram.c
---- nagios.org/cgi/histogram.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/histogram.c 2013-10-01 21:49:29.436624049 +0200
-@@ -983,7 +983,7 @@
- get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/history.c nagios/cgi/history.c
---- nagios.org/cgi/history.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/history.c 2013-10-01 21:49:29.436624049 +0200
-@@ -285,7 +285,7 @@
- get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/notifications.c nagios/cgi/notifications.c
---- nagios.org/cgi/notifications.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/notifications.c 2013-10-01 21:49:29.436624049 +0200
-@@ -272,7 +272,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/outages.c nagios/cgi/outages.c
---- nagios.org/cgi/outages.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/outages.c 2013-10-01 21:49:29.436624049 +0200
-@@ -34,6 +34,8 @@
- extern hoststatus *hoststatus_list;
- extern servicestatus *servicestatus_list;
-
-+extern char *http_charset;
-+
- extern char main_config_file[MAX_FILENAME_LENGTH];
- extern char url_html_path[MAX_FILENAME_LENGTH];
- extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
-@@ -171,7 +173,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/showlog.c nagios/cgi/showlog.c
---- nagios.org/cgi/showlog.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/showlog.c 2013-10-01 21:49:29.436624049 +0200
-@@ -157,7 +157,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/status.c nagios/cgi/status.c
---- nagios.org/cgi/status.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/status.c 2013-10-01 21:49:29.439957458 +0200
-@@ -42,6 +42,8 @@
- extern char url_media_path[MAX_FILENAME_LENGTH];
- extern char url_js_path[MAX_FILENAME_LENGTH];
-
-+extern char *http_charset;
-+
- extern char *service_critical_sound;
- extern char *service_warning_sound;
- extern char *service_unknown_sound;
-@@ -505,7 +507,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/statusmap.c nagios/cgi/statusmap.c
---- nagios.org/cgi/statusmap.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/statusmap.c 2013-10-01 21:49:29.439957458 +0200
-@@ -321,7 +321,7 @@
- get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-Type: text/html\r\n\r\n");
-+ printf("Content-Type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/statuswml.c nagios/cgi/statuswml.c
---- nagios.org/cgi/statuswml.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/statuswml.c 2013-10-01 21:49:29.443290866 +0200
-@@ -38,6 +38,8 @@
-
- extern char *ping_syntax;
-
-+extern char *http_charset;
-+
- #define DISPLAY_HOST 0
- #define DISPLAY_SERVICE 1
- #define DISPLAY_HOSTGROUP 2
-@@ -194,7 +196,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/vnd.wap.wml\r\n\r\n");
-+ printf("Content-type: text/vnd.wap.wml; charset=\"%s\"\r\n\r\n", http_charset);
-
- printf("<?xml version=\"1.0\"?>\n");
- printf("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");
-diff -ur nagios.org/cgi/statuswrl.c nagios/cgi/statuswrl.c
---- nagios.org/cgi/statuswrl.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/statuswrl.c 2013-10-01 21:49:29.443290866 +0200
-@@ -39,6 +39,8 @@
- extern char url_images_path[MAX_FILENAME_LENGTH];
- extern char url_logo_images_path[MAX_FILENAME_LENGTH];
-
-+extern char *http_charset;
-+
- extern char *statuswrl_include;
-
- extern int default_statuswrl_layout_method;
-@@ -197,7 +199,7 @@
- get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-Type: x-world/x-vrml\r\n\r\n");
-+ printf("Content-Type: x-world/x-vrml; charset=\"%s\"\r\n\r\n", http_charset);
-
- return;
- }
-diff -ur nagios.org/cgi/summary.c nagios/cgi/summary.c
---- nagios.org/cgi/summary.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/summary.c 2013-10-01 21:49:29.443290866 +0200
-@@ -662,9 +662,9 @@
- printf("Expires: %s\r\n", date_time);
-
- if(output_format == HTML_OUTPUT)
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
- else {
-- printf("Content-type: text/plain\r\n\r\n");
-+ printf("Content-type: text/plain; charset=\"%s\"\r\n\r\n", http_charset);
- return;
- }
-
-diff -ur nagios.org/cgi/tac.c nagios/cgi/tac.c
---- nagios.org/cgi/tac.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/tac.c 2013-10-01 21:49:29.443290866 +0200
-@@ -50,6 +50,8 @@
- extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
- extern char url_media_path[MAX_FILENAME_LENGTH];
-
-+extern char *http_charset;
-+
- extern int refresh_rate;
-
- extern char *service_critical_sound;
-@@ -281,7 +283,7 @@
- get_time_string(&expire_time, date_time, (int)sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/cgi/trends.c nagios/cgi/trends.c
---- nagios.org/cgi/trends.c 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/cgi/trends.c 2013-10-01 21:49:29.446624276 +0200
-@@ -42,6 +42,8 @@
- extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
- extern char physical_images_path[MAX_FILENAME_LENGTH];
-
-+extern char *http_charset;
-+
- extern int log_rotation_method;
-
- /* archived state types */
-@@ -1182,7 +1184,7 @@
- get_time_string(&expire_time, date_time, sizeof(date_time), HTTP_DATE_TIME);
- printf("Expires: %s\r\n", date_time);
-
-- printf("Content-type: text/html\r\n\r\n");
-+ printf("Content-type: text/html; charset=\"%s\"\r\n\r\n", http_charset);
-
- if(embedded == TRUE)
- return;
-diff -ur nagios.org/include/cgiutils.h nagios/include/cgiutils.h
---- nagios.org/include/cgiutils.h 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/include/cgiutils.h 2013-10-01 21:49:29.446624276 +0200
-@@ -408,6 +408,9 @@
- #define LIFO_ERROR_FILE 2
- #define LIFO_ERROR_DATA 3
-
-+/************************** HTTP CHARSET ****************************/
-+
-+#define DEFAULT_HTTP_CHARSET "utf-8"
-
-
-
-diff -ur nagios.org/include/objects.h nagios/include/objects.h
---- nagios.org/include/objects.h 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/include/objects.h 2013-10-01 21:50:02.750744397 +0200
-@@ -707,6 +707,7 @@
- struct timeperiod *dependency_period_ptr;
- } hostdependency;
-
-+extern char *http_charset;
- extern struct command *command_list;
- extern struct timeperiod *timeperiod_list;
- extern struct host *host_list;
-diff -ur nagios.org/sample-config/cgi.cfg.in nagios/sample-config/cgi.cfg.in
---- nagios.org/sample-config/cgi.cfg.in 2013-09-20 21:01:20.000000000 +0200
-+++ nagios/sample-config/cgi.cfg.in 2013-10-01 21:49:29.446624276 +0200
-@@ -35,6 +35,11 @@
- url_html_path=@htmurl@
-
-
-+# HTTP CHARSET
-+# This defines charset that is sent with HTTP headers.
-+
-+http_charset=utf-8
-+
-
- # CONTEXT-SENSITIVE HELP
- # This option determines whether or not a context-sensitive