From ea6c84f64b7987eaef42ca61b7cc55fbb9d7e4ec Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Thu, 10 May 2007 11:35:02 +0000 Subject: [PATCH] Bug 376911: Non-text content-types require setting the charset manually in the $cgi->header() call - Patch by guillomovitch@zarb.org r=gerv a=mkanat git-svn-id: svn://10.0.0.236/trunk@226249 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/duplicates.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/duplicates.cgi b/mozilla/webtools/bugzilla/duplicates.cgi index 94b35df9794..e393d7c2571 100755 --- a/mozilla/webtools/bugzilla/duplicates.cgi +++ b/mozilla/webtools/bugzilla/duplicates.cgi @@ -266,7 +266,13 @@ my $format = $template->get_format("reports/duplicates", scalar($cgi->param('format')), scalar($cgi->param('ctype'))); -print $cgi->header($format->{'ctype'}); +# We set the charset in Bugzilla::CGI, but CGI.pm ignores it unless the +# Content-Type is a text type. In some cases, such as when we are +# generating RDF, it isn't, so we specify the charset again here. +print $cgi->header( + -type => $format->{'ctype'}, + (Bugzilla->params->{'utf8'} ? ('charset', 'utf8') : () ) +); # Generate and return the UI (HTML page) from the appropriate template. $template->process($format->{'template'}, $vars)