From: stronk7 Date: Tue, 28 Mar 2006 18:53:16 +0000 (+0000) Subject: Only convert to UTF8 if we aren't running under UTF8. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ef138cea77527617e6b82ded8dcfcd682cc444ee;p=moodle.git Only convert to UTF8 if we aren't running under UTF8. Please, test this is correct, thanks! --- diff --git a/mod/hotpot/lib.php b/mod/hotpot/lib.php index dd7d467cfd..fc834e433c 100644 --- a/mod/hotpot/lib.php +++ b/mod/hotpot/lib.php @@ -1255,7 +1255,9 @@ class hotpot_xml_tree { if (empty($str)) { $this->xml = array(); } else { - $str = utf8_encode($str); + if (empty($CFG->unicodedb)) { + $str = utf8_encode($str); + } $this->xml = xmlize($str, 0); } $this->xml_root = $xml_root; diff --git a/question/format/hotpot/format.php b/question/format/hotpot/format.php index 956cd9afa4..3b24468ee2 100644 --- a/question/format/hotpot/format.php +++ b/question/format/hotpot/format.php @@ -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); } diff --git a/question/format/qti2/format.php b/question/format/qti2/format.php index 53788268a6..ade71ebd8d 100644 --- a/question/format/qti2/format.php +++ b/question/format/qti2/format.php @@ -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; }