MDL-45432 mod_assign Declare character encoding in onlinetext export
authorTony Butler <tonyjbutler@gmail.com>
Tue, 6 May 2014 10:35:24 +0000 (11:35 +0100)
committerTony Butler <tonyjbutler@gmail.com>
Wed, 7 May 2014 12:07:04 +0000 (13:07 +0100)
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
mod/assign/submission/onlinetext/locallib.php

index 627c6a1..e83ccaf 100644 (file)
@@ -393,7 +393,8 @@ class assign_submission_onlinetext extends assign_submission_plugin {
             $formattedtext = format_text($finaltext,
                                          $onlinetextsubmission->onlineformat,
                                          array('context'=>$this->assignment->get_context()));
-            $submissioncontent = '<html><body>'. $formattedtext . '</body></html>';
+            $head = '<head><meta charset="UTF-8"></head>';
+            $submissioncontent = '<!DOCTYPE html><html>' . $head . '<body>'. $formattedtext . '</body></html>';
 
             $filename = get_string('onlinetextfilename', 'assignsubmission_onlinetext');
             $files[$filename] = array($submissioncontent);