Showing 1 changed files with 3 additions and 1 deletions
+3 -1
sources/news-nyt.php
... ...
@@ -54,11 +54,13 @@ foreach ($articles as $article ) {
54 54
   echo "<hr>";
55 55
   echo "<a name=\"article-$cpt\">";
56 56
   $article_content = file_get_contents($article['link']);
57
+  $article_content_utf8 = mb_convert_encoding($article_content, 'HTML-ENTITIES', "UTF-8");
57 58
   $doc = new DOMDocument();
58 59
   $doc->preserveWhiteSpace = false;
59 60
   $doc->formatOutput       = true;
60 61
   $libxml_previous_state = libxml_use_internal_errors(true);
61
-  $doc->loadHTML($article_content);
62
+  //$doc->loadHTML($article_content);
63
+  $doc->loadHTML($article_content_utf8);
62 64
   libxml_clear_errors();
63 65
   libxml_use_internal_errors($libxml_previous_state);
64 66
   $articles = $doc->getElementsByTagName('article');