Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- parse HTML arguments as UTF-8 strings
karlchenofhelle17591acc3a3
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.javaindex a94baa65b..c4242ad3a 100644--- a/source/de/anomic/http/httpd.java+++ b/source/de/anomic/http/httpd.java@@ -43,16 +43,17 @@package de.anomic.http;import java.io.ByteArrayOutputStream;+import java.io.CharArrayWriter;import java.io.File;import java.io.FileInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.PrintStream;-import java.io.UnsupportedEncodingException;import java.lang.reflect.Constructor;import java.net.InetAddress;import java.net.MalformedURLException;+import java.net.SocketTimeoutException;import java.util.Arrays;import java.util.Date;import java.util.HashMap;@@ -756,12 +757,13 @@ public final class httpd implements serverHandler {return argc;}+ // 16.12.2006 by [FB]: added UTF-character decodingprivate static String parseArg(String s) {// this parses a given value-string from a http property// we replace all "+" by spaces- // and resolve %-escapes with two-digit hex attributes+ // and resolve %-escapes with two- / four-digit hex attributesint pos = 0;- ByteArrayOutputStream baos = new ByteArrayOutputStream(s.length());+ CharArrayWriter baos = new CharArrayWriter(s.length());while (pos < s.length()) {if (s.charAt(pos) == '+') {baos.write(' ');@@ -780,13 +782,7 @@ public final class httpd implements serverHandler {baos.write(s.charAt(pos++));}}- String result;- try {- result = new String(baos.toByteArray(), "UTF-8");- } catch (UnsupportedEncodingException e) {- return null;- }- return result;+ return baos.toString();}