Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15861)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 15862)
@@ -90,5 +90,5 @@
     private static final Pattern REMOVE_DIACRITICS = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
 
-    private static final char[] DEFAULT_STRIP = {'\u200B', '\uFEFF'};
+    private static final String DEFAULT_STRIP = "\uFEFF\u200B";
 
     private static final String[] SIZE_UNITS = {"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"};
@@ -781,5 +781,5 @@
         if (str != null) {
             for (int i = 0; i < str.length(); i++) {
-                if (!isStrippedChar(str.charAt(i), DEFAULT_STRIP)) {
+                if (!isStrippedChar(str.charAt(i), null)) {
                     return false;
                 }
@@ -820,8 +820,4 @@
             return str;
         }
-        return strip(str, stripChars(skipChars));
-    }
-
-    private static String strip(final String str, final char... skipChars) {
 
         int start = 0;
@@ -835,5 +831,5 @@
         }
         boolean trailingSkipChar = true;
-        while (trailingSkipChar && end > start + 1) {
+        while (trailingSkipChar && end > start) {
             trailingSkipChar = isStrippedChar(str.charAt(end - 1), skipChars);
             if (trailingSkipChar) {
@@ -845,27 +841,8 @@
     }
 
-    private static boolean isStrippedChar(char c, final char... skipChars) {
-        return Character.isWhitespace(c) || Character.isSpaceChar(c) || stripChar(skipChars, c);
-    }
-
-    private static char[] stripChars(final String skipChars) {
-        if (skipChars == null || skipChars.isEmpty()) {
-            return DEFAULT_STRIP;
-        }
-
-        char[] chars = new char[DEFAULT_STRIP.length + skipChars.length()];
-        System.arraycopy(DEFAULT_STRIP, 0, chars, 0, DEFAULT_STRIP.length);
-        skipChars.getChars(0, skipChars.length(), chars, DEFAULT_STRIP.length);
-
-        return chars;
-    }
-
-    private static boolean stripChar(final char[] strip, char c) {
-        for (char s : strip) {
-            if (c == s) {
-                return true;
-            }
-        }
-        return false;
+    private static boolean isStrippedChar(char c, final String skipChars) {
+        return Character.isWhitespace(c) || Character.isSpaceChar(c)
+                || DEFAULT_STRIP.indexOf(c) >= 0
+                || (skipChars != null && skipChars.indexOf(c) >= 0);
     }
 
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 15861)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 15862)
@@ -71,4 +71,6 @@
         assertEquals("", Utils.strip("   "));
         assertEquals("", Utils.strip(someWhite));
+        assertEquals("", Utils.strip("\u200B"));
+        assertEquals("", Utils.strip("\uFEFF"));
         assertEquals("a", Utils.strip("a"));
         assertEquals("ab", Utils.strip("ab"));
@@ -85,5 +87,9 @@
 
         // extended skip
+        assertNull(Utils.strip(null, "abc"));
+        assertEquals("", Utils.strip("", "b"));
+        assertEquals("", Utils.strip("abbbb", "ab"));
         assertEquals("a", Utils.strip("a", "b"));
+        assertEquals("a", Utils.strip("abbbb", "b"));
         assertEquals("b", Utils.strip("acbcac", "ac"));
     }
