Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) better errorhandling for last commit
thelic5d302094133
diff --git a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java b/source/de/anomic/htmlFilter/htmlFilterContentScraper.javaindex 9fb48ffd2..995395a6e 100644--- a/source/de/anomic/htmlFilter/htmlFilterContentScraper.java+++ b/source/de/anomic/htmlFilter/htmlFilterContentScraper.java@@ -114,6 +114,8 @@ public class htmlFilterContentScraper extends htmlFilterAbstractScraper implemen}public void setCharset(String charset) throws UnsupportedCharsetException {+ if (charset == null) return;+// testing if charset existsCharset.forName(charset);diff --git a/source/de/anomic/plasma/plasmaParser.java b/source/de/anomic/plasma/plasmaParser.javaindex b97b68aa5..6102f8766 100644--- a/source/de/anomic/plasma/plasmaParser.java+++ b/source/de/anomic/plasma/plasmaParser.java@@ -53,6 +53,8 @@ import java.io.IOException;import java.io.OutputStream;import java.net.MalformedURLException;import java.net.URI;+import java.nio.charset.UnsupportedCharsetException;+import de.anomic.net.URL;import java.util.Arrays;import java.util.HashMap;@@ -550,7 +552,16 @@ public final class plasmaParser {} else if (realtimeParsableMimeTypesContains(mimeType)) {// ...otherwise we make a scraper and transformerhtmlFilterContentScraper scraper = new htmlFilterContentScraper(location);- scraper.setCharset(PARSER_MODE_URLREDIRECTOR);++ // set the charset if known+ if (charset != null) {+ try {+ scraper.setCharset(charset);+ } catch (UnsupportedCharsetException e) {+ serverLog.logWarning("PARSER", "parseSource2: unknown or unsupported charset '" + charset + "'");+ return null;+ }+ }OutputStream hfos = new htmlFilterOutputStream(null, scraper, null, false);serverFileUtils.copy(sourceFile, hfos);