MDL-56629 dataformat_html: Adding UTF-8 charset

Also adding the HEAD tag which was missing.

(credit goes to Frédéric Massart - FMCorz, thanks!)
This commit is contained in:
Eloy Lafuente (stronk7)
2017-07-11 13:55:04 +02:00
parent 3b5086345e
commit 3336effb72
+3 -1
View File
@@ -45,7 +45,8 @@ class writer extends \core\dataformat\base {
* Write the start of the output
*/
public function start_output() {
echo "<!DOCTYPE html><html>";
echo "<!DOCTYPE html><html><head>";
echo \html_writer::empty_tag('meta', ['charset' => 'UTF-8']);
echo \html_writer::tag('title', $this->filename);
echo "<style>
html, body {
@@ -73,6 +74,7 @@ table {
margin: auto;
}
</style>
</head>
<body>";
}