import java.util.logging.Logger;
import org.jsoup.Jsoup;
-import org.xml.sax.InputSource;
import com.rometools.rome.feed.synd.SyndEnclosure;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedInput;
+import com.rometools.rome.io.XmlReader;
import pnews.Article;
import pnews.Category;
}
private static SyndFeed getSyndFeed(String u) throws IllegalArgumentException, FeedException, MalformedURLException, IOException {
- InputStream is = new URL(u).openConnection().getInputStream();
- InputSource source = new InputSource(is);
-
- return new SyndFeedInput().build(source);
+ InputStream is;
+ XmlReader r;
+
+ r = new XmlReader(new URL(u));
+ XmlReader.setDefaultEncoding("UTF-8");
+
+ return new SyndFeedInput().build(r);
}
result.put(Category.TOP,
new String[] {
"http://www.francetvinfo.fr/titres.rss",
- "http://www.france24.com/fr/actualites/rss",
"http://www.rfi.fr/general/rss",
"http://www.cnews.fr/rss/une",
"http://www.ladepeche.fr/rss/a-la-une.rss",
result.put(Category.EUROPE,
new String[] { "http://www.france24.com/fr/europe/rss" });
+
+ result.put(Category.MONDE,
+ new String[] { "http://www.france24.com/fr/actualites/rss" });
+
result.put(Category.ECO,
new String[] { "http://www.france24.com/fr/economie/rss",
}
if (thumbnail == null)
thumbnail = feedImage;
-
+
title = entry.getTitle().trim();
if (entry.getDescription() != null) {
html = HTML.toHTML(articles, cat);
rp.setContentType("text/html");
rp.getWriter().write(html);
+ rp.setCharacterEncoding("UTF-8");
} else {
LOG.severe("writeArticles cannot retrieve any articles");
html = HTML.toHTML(new ArrayList<Article>(), cat);