Index: trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 15542)
+++ trunk/src/org/openstreetmap/josm/tools/OpenBrowser.java	(revision 15543)
@@ -6,4 +6,5 @@
 import java.awt.Desktop;
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
@@ -63,6 +64,6 @@
     public static String displayUrl(String url) {
         try {
-            return displayUrl(new URI(url));
-        } catch (URISyntaxException e) {
+            return displayUrl(Utils.urlToURI(url));
+        } catch (URISyntaxException | MalformedURLException e) {
             Logging.debug(e);
             return e.getMessage();
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 15542)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 15543)
@@ -12,5 +12,4 @@
 import java.io.IOException;
 import java.io.InputStream;
-import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
@@ -69,5 +68,5 @@
             try {
                 if ("#DESKTOP#".equals(program)) {
-                    Desktop.getDesktop().browse(new URI(url));
+                    Desktop.getDesktop().browse(Utils.urlToURI(url));
                 } else if (program.startsWith("$")) {
                     program = System.getenv().get(program.substring(1));
Index: trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 15542)
+++ trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java	(revision 15543)
@@ -40,5 +40,4 @@
 import java.io.Writer;
 import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
 import java.net.URISyntaxException;
 import java.nio.charset.StandardCharsets;
@@ -169,5 +168,5 @@
         try {
             // Desktop API works fine under Windows
-            Desktop.getDesktop().browse(new URI(url));
+            Desktop.getDesktop().browse(Utils.urlToURI(url));
         } catch (IOException | URISyntaxException e) {
             Logging.log(Logging.LEVEL_WARN, "Desktop class failed. Platform dependent fall back for open url in browser.", e);
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15542)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15543)
@@ -18,4 +18,6 @@
 import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLDecoder;
@@ -542,4 +544,33 @@
     }
 
+    /**
+     * Converts the given URL to its URI.
+     * @param url the URL to get URI from
+     * @return the URI of given URL
+     * @throws URISyntaxException if the URL cannot be converted to an URI
+     * @throws MalformedURLException if no protocol is specified, or an unknown protocol is found, or {@code spec} is {@code null}.
+     * @since 15543
+     */
+    public static URI urlToURI(String url) throws URISyntaxException, MalformedURLException {
+        return urlToURI(new URL(url));
+    }
+
+    /**
+     * Converts the given URL to its URI.
+     * @param url the URL to get URI from
+     * @return the URI of given URL
+     * @throws URISyntaxException if the URL cannot be converted to an URI
+     * @since 15543
+     */
+    public static URI urlToURI(URL url) throws URISyntaxException {
+        try {
+            return url.toURI();
+        } catch (URISyntaxException e) {
+            Logging.trace(e);
+            return new URI(
+                    url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(), url.getQuery(), url.getRef());
+        }
+    }
+
     private static final double EPSILON = 1e-11;
 
