content = $this->stripXmlTag($content); // Encode everything in UTF-8 $this->content = Encoding::toUTF8($this->content); // Workarounds $this->content = $this->normalizeData($this->content); } public function filterHtml($str, $item_url) { $content = ''; if ($str) { $filter = new Filter($str, $item_url); $content = $filter->execute(); } return $content; } public function getXmlErrors() { $errors = array(); foreach(\libxml_get_errors() as $error) { $errors[] = sprintf('XML error: %s (Line: %d - Column: %d - Code: %d)', $error->message, $error->line, $error->column, $error->code ); } return implode(', ', $errors); } // Dirty quickfix before XML parsing public function normalizeData($data) { return str_replace("\xc3\x20", '', $data); } public function stripXmlTag($data) { if (strpos($data, '') + 2); } return $data; } // Trim whitespace from the begining, the end and inside a string and don't break utf-8 string public function stripWhiteSpace($value) { $value = str_replace("\r", "", $value); $value = str_replace("\t", "", $value); $value = str_replace("\n", "", $value); return trim($value); } }