Index: /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java	(revision 4800)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/AddWMSLayerPanel.java	(revision 4801)
@@ -347,5 +347,14 @@
             String line;
             StringBuilder ba = new StringBuilder();
-            while((line = br.readLine()) != null) {
+            boolean isFirstLine = true;
+            while ((line = br.readLine()) != null) {
+                // fix #7271
+                // see http://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html
+                final String UTF8_BOM = "\uFEFF";
+                if (isFirstLine && line.startsWith(UTF8_BOM)) {
+                    System.out.println("Removing UTF8_BOM (0xFEFF) from GetCapabilities response");
+                    line = line.substring(1);
+                    isFirstLine = false;
+                }
                 ba.append(line);
                 ba.append("\n");
