Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
* don't throw exception, in case of bad charset in http-header
f1ori08445e42f0a3
diff --git a/source/de/anomic/htmlFilter/htmlFilterInputStream.java b/source/de/anomic/htmlFilter/htmlFilterInputStream.javaindex 927d91915..5f3c55439 100644--- a/source/de/anomic/htmlFilter/htmlFilterInputStream.java+++ b/source/de/anomic/htmlFilter/htmlFilterInputStream.java@@ -51,7 +51,7 @@ public class htmlFilterInputStream extends InputStream implements htmlFilterEvenprivate boolean charsetChanged = false;private boolean endOfHead = false;- private final Reader reader;+ private Reader reader;private Writer writer;public htmlFilterInputStream(@@ -60,7 +60,7 @@ public class htmlFilterInputStream extends InputStream implements htmlFilterEvenfinal yacyURL rooturl,final htmlFilterTransformer transformer,final boolean passbyIfBinarySuspect- ) throws UnsupportedEncodingException {+ ) {// create a input stream for buffereingthis.bufferedIn = new BufferedInputStream(inStream,(int) preBufferSize);this.bufferedIn.mark((int) preBufferSize);@@ -68,7 +68,16 @@ public class htmlFilterInputStream extends InputStream implements htmlFilterEvenfinal htmlFilterContentScraper scraper = new htmlFilterContentScraper(rooturl);//scraper.registerHtmlFilterEventListener(this);- this.reader = new InputStreamReader(this,inputStreamCharset);+ try {+ this.reader = new InputStreamReader(this,inputStreamCharset);+ } catch (UnsupportedEncodingException e) {+ try {+ this.reader = new InputStreamReader(this, "UTF-8");+ } catch (UnsupportedEncodingException e1) {+ // how is that possible?+ this.reader = new InputStreamReader(this);+ }+ }this.writer = new htmlFilterWriter(null,null,scraper,transformer,passbyIfBinarySuspect);}