1.1 --- a/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Sun Dec 23 23:30:06 2012 +0100
1.2 +++ b/launcher/src/main/java/org/apidesign/bck2brwsr/launcher/Bck2BrwsrLauncher.java Tue Dec 25 14:07:02 2012 +0100
1.3 @@ -149,7 +149,7 @@
1.4
1.5 if (id != null && value != null) {
1.6 LOG.log(Level.INFO, "Received result for case {0} = {1}", new Object[]{id, value});
1.7 - value = value.replace("%20", " ");
1.8 + value = decodeURL(value);
1.9 cases.get(Integer.parseInt(id)).result(value, null);
1.10 }
1.11
1.12 @@ -253,6 +253,17 @@
1.13 }
1.14 }
1.15
1.16 + private static String decodeURL(String s) {
1.17 + for (;;) {
1.18 + int pos = s.indexOf('%');
1.19 + if (pos == -1) {
1.20 + return s;
1.21 + }
1.22 + int i = Integer.parseInt(s.substring(pos + 1, pos + 2), 16);
1.23 + s = s.substring(0, pos) + (char)i + s.substring(pos + 2);
1.24 + }
1.25 + }
1.26 +
1.27 private void stopServerAndBrwsr(HttpServer server, Object[] brwsr) throws IOException, InterruptedException {
1.28 Process process = (Process)brwsr[0];
1.29