summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/net/yacy/document/parser/html/ScraperInputStream.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/net/yacy/document/parser/html/ScraperInputStream.java b/source/net/yacy/document/parser/html/ScraperInputStream.java
index 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;
}
}
}