Index: trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 18566)
+++ trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java	(revision 18567)
@@ -550,4 +550,5 @@
         supportedMimeTypes.add("image/jpgpng");         // used by ESRI
         supportedMimeTypes.add("image/png8");           // used by geoserver
+        supportedMimeTypes.add("image/png; mode=8bit"); // used by MapServer
         if (supportedMimeTypes.contains("image/jpeg")) {
             supportedMimeTypes.add("image/jpg"); // sometimes misspelled by Arcgis
@@ -607,8 +608,12 @@
         if (layer.format == null) {
             // no format found - it's mandatory parameter - can't use this layer
-            Logging.warn(tr("Can''t use layer {0} because no supported formats where found. Layer is available in formats: {1}",
+            Logging.warn(tr("Can''t use layer {0} because no supported formats were found. Layer is available in formats: {1}",
                     layer.getUserTitle(),
                     String.join(", ", unsupportedFormats)));
             return null;
+        }
+        // Java has issues if spaces are not URL encoded. Ensure that we URL encode the spaces.
+        if (layer.format.contains(" ")) {
+            layer.format = layer.format.replace(" ", "&20");
         }
         return layer;
