Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

- ConfigProfile_p.html now transmits usable encoding for other than 7-bit ASCII charset, see TODO in httpd.parseArg(String)

karlchenofhell340dc52a9d37
diff --git a/htroot/ConfigProfile_p.html b/htroot/ConfigProfile_p.html
index b066ba24c..6d906a43b 100644
--- a/htroot/ConfigProfile_p.html
+++ b/htroot/ConfigProfile_p.html
@@ -14,7 +14,7 @@
<p>
You do not need to provide any personal data here, but if you want to distribute your contact information, you can do that here.
</p>
- <form action="ConfigProfile_p.html">
+ <form action="ConfigProfile_p.html" accept-charset="ascii">
<fieldset>
<dl>
<dt><label for="name">Name</label></dt>
diff --git a/source/de/anomic/http/httpd.java b/source/de/anomic/http/httpd.java
index 4af61af94..cd44ec231 100644
--- a/source/de/anomic/http/httpd.java
+++ b/source/de/anomic/http/httpd.java
@@ -777,6 +777,19 @@ public final class httpd implements serverHandler {
baos.write(Integer.parseInt(s.substring(pos + 2, pos + 6), 16));
pos += 6;
} else { // normal escape
+ // currently one escape is treated as one char, which only works if
+ // formulars accept-charset=ascii are used. This is wrong if
+ // formulars are set to accept-charset=UTF-8, then many escaped bytes
+ // are sent, but they belong together to one char
+
+ // TODO: UTF-8 escapes: i.e. "%C3%A4" should be 'ä', but is now "ä"
+ // - parse out subsequent escapes
+ // - check which of these 'belong together', see http://de.wikipedia.org/wiki/UTF-8
+ // - write the UTF-8 escapes together as one char
+
+ // XXX: implement an own UTF-8 converter as described above or
+ // revert this method to use bytes and let Java do the UTF-8-parsing?
+ // i.e. new String(result[], "UTF-8");
baos.write(Integer.parseInt(s.substring(pos + 1, pos + 3), 16));
pos += 3;
}