Merged XML UTF-8 fixed from stable (see bug 1927)
authormoodler <moodler>
Mon, 13 Sep 2004 08:17:09 +0000 (08:17 +0000)
committermoodler <moodler>
Mon, 13 Sep 2004 08:17:09 +0000 (08:17 +0000)
backup/restorelib.php
filter/multilang/filter.php
lib/xmlize.php
mod/scorm/lib.php

index c6b28ff..6aabae3 100644 (file)
         
         $status = true;
 
-        $xml_parser = xml_parser_create();
+        $xml_parser = xml_parser_create('UTF-8');
         $moodle_parser = new MoodleParser();
         $moodle_parser->todo = $todo;
         $moodle_parser->preferences = $preferences;
index c736e46..440caa6 100644 (file)
@@ -103,7 +103,7 @@ class XMLParser {
     $this->texts['en'] = $data;\r
 \r
     /// Create parser\r
-    $xml_parser = xml_parser_create(); \r
+    $xml_parser = xml_parser_create('UTF-8'); \r
     xml_set_object($xml_parser, &$this); \r
     xml_set_element_handler($xml_parser, 'startElement', 'endElement'); \r
     xml_set_character_data_handler($xml_parser, 'characterData'); \r
index 3bffc6a..db9df07 100644 (file)
  *
  */
 
-function xmlize($data, $WHITE=1) {
+function xmlize($data, $WHITE=1, $encoding='UTF-8') {
 
     $data = trim($data);
     $vals = $index = $array = array();
-    $parser = xml_parser_create();
+    $parser = xml_parser_create($encoding);
     xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
     xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, $WHITE);
     xml_parse_into_struct($parser, $data, $vals, $index);
index 403f716..060e784 100755 (executable)
@@ -479,7 +479,7 @@ function scorm_parse($basedir,$file,$scorm_id) {
     $level = 0;
     $parent[$level] = '/';
 
-    $xml_parser = xml_parser_create();
+    $xml_parser = xml_parser_create('UTF-8');
     // use case-folding so we are sure to find the tag in $map_array
     xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, true);
     xml_set_element_handler($xml_parser, 'scorm_startElement', 'scorm_endElement');