Permalink
Browse files

Add proper charset to web test runner.

Fixes #2804
  • Loading branch information...
markstory committed Apr 19, 2012
1 parent c49da62 commit dec67ef2599e9985cc923b7f5cd81f55685db751
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
@@ -33,12 +33,24 @@ class CakeHtmlReporter extends CakeBaseReporter {
*/
public function paintHeader() {
$this->_headerSent = true;
+ $this->sendContentType();
$this->sendNoCacheHeaders();
$this->paintDocumentStart();
$this->paintTestMenu();
echo "<ul class='tests'>\n";
}
+/**
+ * Set the content-type header so it is in the correct encoding.
+ *
+ * @return void
+ */
+ public function sendContentType() {
+ if (!headers_sent()) {
+ header('Content-Type: text/html; charset=' . Configure::read('App.encoding'));
+ }
+ }
+
/**
* Paints the document start content contained in header.php
*

0 comments on commit dec67ef

Please sign in to comment.