Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
HTML5 <meta charset="...> support
Johnny19846006b19ae770
diff --git a/source/net/yacy/document/parser/html/ScraperInputStream.java b/source/net/yacy/document/parser/html/ScraperInputStream.javaindex e722f1f93..2041aec75 100644--- a/source/net/yacy/document/parser/html/ScraperInputStream.java+++ b/source/net/yacy/document/parser/html/ScraperInputStream.java@@ -109,7 +109,11 @@ public class ScraperInputStream extends InputStream implements ScraperListener {if (tagname == null || tagname.isEmpty()) return;if (tagname.equalsIgnoreCase("meta")) {- if (tagopts.containsKey("http-equiv")) {+ if (tagopts.containsKey("charset")) {+ // parse lines like <meta charset="UTF-8">+ this.detectedCharset = tagopts.getProperty("charset");+ this.charsetChanged = true;+ } else if (tagopts.containsKey("http-equiv")) {final String value = tagopts.getProperty("http-equiv");if (value.equalsIgnoreCase("Content-Type")) {// parse lines like <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">@@ -117,10 +121,6 @@ public class ScraperInputStream extends InputStream implements ScraperListener {this.detectedCharset = extractCharsetFromMimetypeHeader(contentType);if (this.detectedCharset != null && this.detectedCharset.length() > 0) {this.charsetChanged = true;- } else if (tagopts.containsKey("charset")) {- // sometimes the charset property is configured as extra attribut. try it ...- this.detectedCharset = tagopts.getProperty("charset");- this.charsetChanged = true;}}}