7. Code
The actual code in more detail.
Changes to settings.php set some header parameters that must be set before any content is sent to the browser. Drupal has a couple of built in headers that need to be overridden. Changes are therefore required to a couple of lines in common.inc.
<?php
// common.inc line 60
function drupal_get_html_head() {
global $base_url;
$output = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
$output .= "<base href=\"$base_url/\" />\n";
$output .= theme('stylesheet_import', 'misc/drupal.css');
return $output . drupal_set_html_head();
}
// common.inc line 1875
drupal_set_header('Content-Type: text/html; charset=utf-8');
Change to the following. This overrides the default Content-Type. Note that if roll-back is required, common.inc must be reverted also.
<?php
// common.inc line 60
function drupal_get_html_head() {
global $output;
return $output . drupal_set_html_head();
}
// common.inc line 1875
#drupal_set_header('Content-Type: text/html; charset=utf-8');