Skip to content
Permalink
Browse files

Merged XML UTF-8 fixed from stable (see bug 1927)

  • Loading branch information...
moodler
moodler committed Sep 13, 2004
1 parent f02511d commit b797605898d6ac69398eb15cce7ddac7db67f0d8
Showing with 5 additions and 5 deletions.
  1. +1 −1 backup/restorelib.php
  2. +1 −1 filter/multilang/filter.php
  3. +2 −2 lib/xmlize.php
  4. +1 −1 mod/scorm/lib.php
@@ -2964,7 +2964,7 @@ function restore_read_xml ($xml_file,$todo,$preferences) {
$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;
@@ -103,7 +103,7 @@ function XMLParser($data) {
$this->texts['en'] = $data;
/// Create parser
$xml_parser = xml_parser_create();
$xml_parser = xml_parser_create('UTF-8');
xml_set_object($xml_parser, &$this);
xml_set_element_handler($xml_parser, 'startElement', 'endElement');
xml_set_character_data_handler($xml_parser, 'characterData');
@@ -20,11 +20,11 @@
*
*/
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);
@@ -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');

0 comments on commit b797605

Please sign in to comment.
You can’t perform that action at this time.