UTF-8 is now set in XML parser
authorRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2009 11:33:39 +0000 (11:33 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 2 Dec 2009 11:33:39 +0000 (11:33 +0000)
inc/classes/main/parser/xml/class_XmlParser.php

index e21044f..f8a6273 100644 (file)
@@ -64,7 +64,8 @@ class XmlParser extends BaseParser implements Parseable {
        public function parseXmlContent ($content) {
                // Convert all to UTF8
                if (function_exists('recode')) {
-                       $content = recode("html..utf8", $content);
+                       // Recode found, so use it
+                       $content = recode('html..utf8', $content);
                } else {
                        // @TODO We need to find a fallback solution here
                        $this->partialStub('Cannot find recode extension!');
@@ -76,6 +77,9 @@ class XmlParser extends BaseParser implements Parseable {
                // Force case-folding to on
                xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
 
+               // Set UTF-8
+               xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
+
                // Get template instance
                $templateInstance = $this->getTemplateInstance();