correctly set UTF-8 encoding for TextFormatter input

This commit is contained in:
oliver 2015-05-12 18:55:11 +02:00
commit 3746336637

View file

@ -120,7 +120,7 @@
} }
try { try {
$dom = new \DOMDocument(); $dom = new \DOMDocument();
$dom->loadHTML($string); $dom->loadHTML('<?xml encoding="UTF-8">'.$string);
foreach($dom->getElementsByTagName('a') as $link) { foreach($dom->getElementsByTagName('a') as $link) {
$link->setAttribute('target', '_blank'); $link->setAttribute('target', '_blank');
} }