From 6e09da89790f631f220484c098ac7857deccbcb4 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 22 Oct 2014 14:26:43 +0200 Subject: fix encoding --- articleenhancer/xpatharticleenhancer.php | 2 +- fetcher/feedfetcher.php | 4 +++- fetcher/log.txt | 1 + templates/admin.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 fetcher/log.txt diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php index 8e45636d2..23af24893 100644 --- a/articleenhancer/xpatharticleenhancer.php +++ b/articleenhancer/xpatharticleenhancer.php @@ -53,7 +53,7 @@ class XPathArticleEnhancer implements ArticleEnhancer { if(preg_match('/(?<=charset=)[^;]*/', $contentType, $matches)) { $encoding = $matches[0]; $body = mb_convert_encoding($body, 'HTML-ENTITIES', - $encoding); + strtoupper($encoding)); } $dom = new DOMDocument(); diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php index 7cd439669..4efe0215c 100644 --- a/fetcher/feedfetcher.php +++ b/fetcher/feedfetcher.php @@ -129,7 +129,9 @@ class FeedFetcher implements IFeedFetcher { $item->setGuid($guid); // purification is done in the service layer - $item->setBody($parsedItem->getContent()); + $body = $parsedItem->getContent(); + $body = mb_convert_encoding($body, 'HTML-ENTITIES', 'UTF-8'); + $item->setBody($body); // pubdate is not required. if not given use the current date $date = $parsedItem->getDate(); diff --git a/fetcher/log.txt b/fetcher/log.txt new file mode 100644 index 000000000..30062d8fd --- /dev/null +++ b/fetcher/log.txt @@ -0,0 +1 @@ +
政府開発援助の役割・意義、日本が行ってきた援助の成果や評価についてご紹介。

Ads by Trend Match

\ No newline at end of file diff --git a/templates/admin.php b/templates/admin.php index a73bd2f51..ef4cb8625 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -9,7 +9,7 @@ style('news', 'admin');

>

-- cgit v1.2.3