Index: /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 5771)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 5772)
@@ -35,4 +35,5 @@
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.tools.Shortcut;
+import org.openstreetmap.josm.tools.Utils;
 
 /**
@@ -119,5 +120,5 @@
         if (dialog.getValue() != 1) return;
         remindUploadAddressHistory(uploadAddresses);
-        openUrl(layer.isSelected(), uploadAddresses.getText());
+        openUrl(layer.isSelected(), Utils.strip(uploadAddresses.getText()));
     }
     
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 5771)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 5772)
@@ -573,3 +573,34 @@
         return connection;
     }
+    
+    /**
+     * An alternative to {@link String#trim()} to effectively remove all leading and trailing white characters, including Unicode ones.
+     * @see <a href="http://closingbraces.net/2008/11/11/javastringtrim/">Java’s String.trim has a strange idea of whitespace</a>
+     * @see <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4080617">JDK bug 4080617</a>  
+     * @param str The string to strip
+     * @return <code>str</code>, without leading and trailing characters, according to 
+     *         {@link Character#isWhitespace(char)} and {@link Character#isSpaceChar(char)}.
+     * @since 5772
+     */
+    public static String strip(String str) {
+        if (str == null || str.isEmpty()) {
+            return str;
+        }
+        int start = 0, end = str.length();
+        boolean leadingWhite = true;
+        while (leadingWhite && start < end) {
+            char c = str.charAt(start);
+            if (leadingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c))) {
+                start++;
+            }
+        }
+        boolean trailingWhite = true;
+        while (trailingWhite && end > start+1) {
+            char c = str.charAt(end-1);
+            if (trailingWhite = (Character.isWhitespace(c) || Character.isSpaceChar(c))) {
+                end--;
+            }
+        }
+        return str.substring(start, end);
+    }
 }
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 5772)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 5772)
@@ -0,0 +1,53 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.tools;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Unit tests of {@link Utils} class.
+ */
+public class UtilsTest {
+
+    /**
+     * Test of {@link Utils#strip} method.
+     */
+    @Test
+    public void testStrip() {
+        final String someWhite = 
+            "\u00A0"+ // SPACE_SEPARATOR
+            "\u2007"+ // LINE_SEPARATOR
+            "\u202F"+ // PARAGRAPH_SEPARATOR
+            "\u0009"+ // HORIZONTAL TABULATION
+            "\n"    + // LINE FEED (U+000A, cannot be put as it in Java)
+            "\u000B"+ // VERTICAL TABULATION
+            "\u000C"+ // FORM FEED
+            "\r"    + // CARRIAGE RETURN (U+000D, cannot be put as it in Java)
+            "\u001C"+ // FILE SEPARATOR
+            "\u001D"+ // GROUP SEPARATOR
+            "\u001E"+ // RECORD SEPARATOR
+            "\u001F"+ // UNIT SEPARATOR
+            "\u2003"+ // EM SPACE
+            "\u2007"+ // FIGURE SPACE
+            "\u200B"+ // ZERO WIDTH SPACE
+            "\u3000"; // IDEOGRAPHIC SPACE
+        Assert.assertNull(Utils.strip(null));
+        Assert.assertEquals("", Utils.strip(""));
+        Assert.assertEquals("", Utils.strip(" "));
+        Assert.assertEquals("", Utils.strip("  "));
+        Assert.assertEquals("", Utils.strip("   "));
+        Assert.assertEquals("", Utils.strip(someWhite));
+        Assert.assertEquals("a", Utils.strip("a"));
+        Assert.assertEquals("ab", Utils.strip("ab"));
+        Assert.assertEquals("abc", Utils.strip("abc"));
+        Assert.assertEquals("a", Utils.strip(" a"));
+        Assert.assertEquals("ab", Utils.strip(" ab"));
+        Assert.assertEquals("abc", Utils.strip(" abc"));
+        Assert.assertEquals("a", Utils.strip("a "));
+        Assert.assertEquals("ab", Utils.strip("ab "));
+        Assert.assertEquals("abc", Utils.strip("abc "));
+        Assert.assertEquals("a", Utils.strip(someWhite+"a"+someWhite));
+        Assert.assertEquals("ab", Utils.strip(someWhite+"ab"+someWhite));
+        Assert.assertEquals("abc", Utils.strip(someWhite+"abc"+someWhite));
+    }
+}
