]> git.mjollnir.org Git - moodle.git/commitdiff
Only convert to UTF8 if we aren't running under UTF8.
authorstronk7 <stronk7>
Tue, 28 Mar 2006 18:53:16 +0000 (18:53 +0000)
committerstronk7 <stronk7>
Tue, 28 Mar 2006 18:53:16 +0000 (18:53 +0000)
Please, test this is correct, thanks!

mod/hotpot/lib.php
question/format/hotpot/format.php
question/format/qti2/format.php

index dd7d467cfd473f5dbf6a7cc07ecb2cf4ab9f9cd4..fc834e433cd0c42dab303cae73b18e93bddce0aa 100644 (file)
@@ -1255,7 +1255,9 @@ class hotpot_xml_tree {
                if (empty($str)) {\r
                        $this->xml =  array();\r
                } else {\r
-                       $str = utf8_encode($str);\r
+            if (empty($CFG->unicodedb)) {\r
+                           $str = utf8_encode($str);\r
+            }\r
                        $this->xml =  xmlize($str, 0);\r
                }\r
                $this->xml_root = $xml_root;\r
index 956cd9afa4d60cbc3ba9949bada63620fb50e4ec..3b24468ee2dc8aa05066cedafd74d9c998ab9df4 100644 (file)
@@ -472,7 +472,9 @@ class hotpot_xml_tree {
             // encode htmlentities in JCloze
             $this->encode_cdata($str, 'gap-fill');
             // encode as utf8
-            $str = utf8_encode($str);
+            if (empty($CFG->unicodedb)) {
+                $str = utf8_encode($str);
+            }
             // xmlize (=convert xml to tree)
             $this->xml =  xmlize($str, 0);
         }
index 53788268a6e272e598c79316387b55b2b4638dba..ade71ebd8d63e71b2bb5b54d099c35dde85145e7 100644 (file)
@@ -387,7 +387,11 @@ function handle_questions_media(&$questions, $path, $courseid) {
         $smarty->assign('course', $course);
         $smarty->assign('lang', $this->lang);
         $expout = $smarty->fetch('imsmanifest.tpl');
-        echo utf8_encode($expout);
+        if (!empty($CFG->unicodedb)) {
+            echo $expout;
+        } else {
+            echo utf8_encode($expout);
+        }
         return true;
     }