Reverted because xml_set_object() requires a variable to be passed by reference...
[core.git] / inc / classes / main / parser / xml / class_XmlParser.php
index e21044f7f2f1934660ba7a1cfb60b0ddc8da10af..1281cb4d74a6fb418e6bfffc64b79b4d2a945d98 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,7 +77,10 @@ class XmlParser extends BaseParser implements Parseable {
                // Force case-folding to on
                xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
 
-               // Get template instance
+               // Set UTF-8
+               xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
+
+               // Get instance (we need this :( )
                $templateInstance = $this->getTemplateInstance();
 
                // Set object