diff -uNr htdig-3.1.3.orig/htcommon/defaults.cc htdig-3.1.3/htcommon/defaults.cc --- htdig-3.1.3.orig/htcommon/defaults.cc Wed Sep 22 18:18:39 1999 +++ htdig-3.1.3/htcommon/defaults.cc Tue Nov 2 15:28:38 1999 @@ -47,6 +47,7 @@ {"doc_db", "${database_base}.docdb"}, {"doc_index", "${database_base}.docs.index"}, {"doc_list", "${database_base}.docs"}, + {"encoding", ""}, {"end_ellipses", " ..."}, {"endings_affix_file", "${common_dir}/english.aff"}, {"endings_dictionary", "${common_dir}/english.0"}, diff -uNr htdig-3.1.3.orig/htsearch/Display.cc htdig-3.1.3/htsearch/Display.cc --- htdig-3.1.3.orig/htsearch/Display.cc Wed Sep 22 18:18:44 1999 +++ htdig-3.1.3/htsearch/Display.cc Tue Nov 2 15:42:51 1999 @@ -99,6 +99,7 @@ if (number <= 0) number = 10; int startAt = (pageNumber - 1) * number; + char *encoding = config["encoding"]; if (config.Boolean("logging")) { @@ -119,13 +120,19 @@ // No matches. // delete matches; - cout << "Content-type: text/html\r\n\r\n"; + if ( strcmp(encoding, "") == 0 ) + cout << "Content-type: text/html\r\n\r\n"; + else + cout << "Content-type: text/html; charset=" << encoding << "\r\n\r\n"; displayNomatch(); return; } // maxScore = match->getScore(); // now done in buildMatchList() - - cout << "Content-type: text/html\r\n\r\n"; + + if ( strcmp(encoding, "") == 0 ) + cout << "Content-type: text/html\r\n\r\n"; + else + cout << "Content-type: text/html; charset=" << encoding << "\r\n\r\n"; String wrap_file = config["search_results_wrapper"]; String *wrapper = 0; char *header = 0, *footer = 0; @@ -597,7 +604,12 @@ void Display::displaySyntaxError(char *message) { - cout << "Content-type: text/html\r\n\r\n"; + char *encoding = config["encoding"]; + + if ( strcmp(encoding, "") == 0 ) + cout << "Content-type: text/html\r\n\r\n"; + else + cout << "Content-type: text/html; charset=" << encoding << "\r\n\r\n"; setVariables(0, 0); vars.Add("SYNTAXERROR", new String(message)); diff -uNr htdig-3.1.3.orig/installdir/htdig.conf htdig-3.1.3/installdir/htdig.conf --- htdig-3.1.3.orig/installdir/htdig.conf Wed Sep 22 18:18:47 1999 +++ htdig-3.1.3/installdir/htdig.conf Tue Nov 2 15:27:06 1999 @@ -115,6 +115,12 @@ # template_name: long # +# The following parameter change encoding header field of HTTP response +# generated by htsearch. If your search results are in ISO-8859-1 character +# set, leave this uncommented. +#encoding: ISO-8859-1 + +# # The following are used to change the text for the page index. # The defaults are just boring text numbers. These images spice # up the result pages quite a bit. (Feel free to do whatever, though)