Index: trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
===================================================================
--- trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 6587)
+++ trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java	(revision 6588)
@@ -5,7 +5,5 @@
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.net.URL;
-import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -137,16 +135,8 @@
     }
 
-    protected final String encodePartialUrl(String url, String safePart) {
-        if (url != null && safePart != null) {
-            int pos = url.indexOf(safePart);
-            if (pos > -1) {
-                pos += safePart.length();
-                try {
-                    return url.substring(0, pos) + URLEncoder.encode(url.substring(pos), "UTF-8").replaceAll("\\+", "%20");
-                } catch (UnsupportedEncodingException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
+    /**
+     * This allows subclasses to perform operations on the URL before {@link #loadUrl} is performed.
+     */
+    protected String modifyUrlBeforeLoad(String url) {
         return url;
     }
@@ -159,10 +149,5 @@
     @Override
     public Future<?> loadUrl(boolean new_layer, String url, ProgressMonitor progressMonitor) {
-        if (url.matches(PATTERN_OVERPASS_API_URL)) {
-            url = encodePartialUrl(url, "/interpreter?data="); // encode only the part after the = sign
-
-        } else if (url.matches(PATTERN_OVERPASS_API_XAPI_URL)) {
-            url = encodePartialUrl(url, "/xapi?"); // encode only the part after the ? sign
-        }
+        url = modifyUrlBeforeLoad(url);
         downloadTask = new DownloadTask(new_layer,
                 new OsmServerLocationReader(url),
