Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) next bugfix for UTF-8 - Sending UFT-8 messages to other peers did not work - httpd.java: minor corrections for UTF-8
theli2a06ce553855
diff --git a/source/de/anomic/http/httpc.java b/source/de/anomic/http/httpc.javaindex a79fef42d..acd86f72a 100644--- a/source/de/anomic/http/httpc.java+++ b/source/de/anomic/http/httpc.java@@ -1013,29 +1013,29 @@ public final class httpc {Enumeration e = args.keys();while (e.hasMoreElements()) {// start with a boundary- out.write(boundary.getBytes());+ out.write(boundary.getBytes("UTF-8"));out.write(serverCore.crlf);// write valuekey = (String) e.nextElement();value = args.get(key, "");if ((files != null) && (files.containsKey(key))) {// we are about to write a file- out.write(("Content-Disposition: form-data; name=" + '"' + key + '"' + "; filename=" + '"' + value + '"').getBytes());+ out.write(("Content-Disposition: form-data; name=" + '"' + key + '"' + "; filename=" + '"' + value + '"').getBytes("UTF-8"));out.write(serverCore.crlf);out.write(serverCore.crlf);out.write((byte[]) files.get(key));out.write(serverCore.crlf);} else {// write a single value- out.write(("Content-Disposition: form-data; name=" + '"' + key + '"').getBytes());+ out.write(("Content-Disposition: form-data; name=" + '"' + key + '"').getBytes("UTF-8"));out.write(serverCore.crlf);out.write(serverCore.crlf);- out.write(value.getBytes());+ out.write(value.getBytes("UTF-8"));out.write(serverCore.crlf);}}// finish with a boundary- out.write(boundary.getBytes());+ out.write(boundary.getBytes("UTF-8"));out.write(serverCore.crlf);}// create body arraydiff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.javaindex 238316b1d..f724b3643 100644--- a/source/de/anomic/http/httpd.java+++ b/source/de/anomic/http/httpd.java@@ -1118,14 +1118,14 @@ public final class httpd implements serverHandler {tp.put("printStackTrace",1);serverByteBuffer errorMsg = new serverByteBuffer(100);- errorMsg.append("<i>Exception occurred:</i> <b>")- .append(stackTrace.toString())- .append("</b>\r\n\r\n")- .append("</i>TRACE:</i>\r\n");+ errorMsg.append("<i>Exception occurred:</i> <b>".getBytes("UTF-8"))+ .append(stackTrace.toString().getBytes("UTF-8"))+ .append("</b>\r\n\r\n".getBytes("UTF-8"))+ .append("</i>TRACE:</i>\r\n".getBytes("UTF-8"));stackTrace.printStackTrace(new PrintStream(errorMsg));- errorMsg.append("\r\n");+ errorMsg.append("\r\n".getBytes("UTF-8"));- tp.put("printStackTrace_stacktrace",errorMsg.toString().replaceAll("\n","<br>"));+ tp.put("printStackTrace_stacktrace",(new String(errorMsg.getBytes(),"UTF-8")).replaceAll("\n","<br>"));} else {tp.put("printStackTrace",0);}