... | ... |
@@ -51,11 +51,12 @@ foreach ($articles as $article ) { |
51 | 51 |
echo "<hr>"; |
52 | 52 |
echo "<a name=\"article-$cpt\">"; |
53 | 53 |
$article_content = file_get_contents($article['link']); |
54 |
+ $article_content_utf8 = mb_convert_encoding($article_content, 'HTML-ENTITIES', "UTF-8"); |
|
54 | 55 |
$doc = new DOMDocument(); |
55 | 56 |
$doc->preserveWhiteSpace = false; |
56 | 57 |
$doc->formatOutput = true; |
57 | 58 |
$libxml_previous_state = libxml_use_internal_errors(true); |
58 |
- $doc->loadHTML($article_content); |
|
59 |
+ $doc->loadHTML($article_content_utf8); |
|
59 | 60 |
libxml_clear_errors(); |
60 | 61 |
libxml_use_internal_errors($libxml_previous_state); |
61 | 62 |
$articles = $doc->getElementsByTagName('article'); |