From: Roland Häder Date: Wed, 2 Dec 2009 11:33:39 +0000 (+0000) Subject: UTF-8 is now set in XML parser X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=12b48565216b48aedf510a5b6d31cf4b5a8a8eec UTF-8 is now set in XML parser --- diff --git a/inc/classes/main/parser/xml/class_XmlParser.php b/inc/classes/main/parser/xml/class_XmlParser.php index e21044f7..f8a6273e 100644 --- a/inc/classes/main/parser/xml/class_XmlParser.php +++ b/inc/classes/main/parser/xml/class_XmlParser.php @@ -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();