Index: /trunk/src/org/openstreetmap/josm/data/Version.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6420)
+++ /trunk/src/org/openstreetmap/josm/data/Version.java	(revision 6421)
@@ -236,5 +236,5 @@
         }
         String result = "JOSM/1.5 ("+ s+" "+LanguageInfo.getJOSMLocaleCode()+")";
-        if (includeOsDetails) {
+        if (includeOsDetails && Main.platform != null) {
             result += " " + Main.platform.getOSDescription();
         }
Index: /trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6420)
+++ /trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 6421)
@@ -13,4 +13,5 @@
 import java.awt.datatransfer.Transferable;
 import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.BufferedInputStream;
 import java.io.BufferedReader;
 import java.io.Closeable;
@@ -37,8 +38,11 @@
 import java.util.Iterator;
 import java.util.List;
+import java.util.zip.GZIPInputStream;
 import java.util.zip.ZipFile;
 
+import org.apache.tools.bzip2.CBZip2InputStream;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Version;
+import org.openstreetmap.josm.io.FileImporter;
 
 /**
@@ -638,5 +642,25 @@
      */
     public static InputStream openURL(URL url) throws IOException {
-        return setupURLConnection(url.openConnection()).getInputStream();
+        return openURLAndDecompress(url, false);
+    }
+
+    /**
+     * Opens a connection to the given URL, sets the User-Agent property to JOSM's one, and decompresses stream if necessary.
+     * @param url The url to open
+     * @param decompress whether to wrap steam in a {@link GZIPInputStream} or {@link CBZip2InputStream}
+     *                   if the {@code Content-Type} header is set accordingly.
+     * @return An stream for the given URL
+     * @throws IOException if an I/O exception occurs.
+     * @since 6421
+     */
+    public static InputStream openURLAndDecompress(final URL url, final boolean decompress) throws IOException {
+        final URLConnection connection = setupURLConnection(url.openConnection());
+        if (decompress && "application/x-gzip".equals(connection.getHeaderField("Content-Type"))) {
+            return new GZIPInputStream(connection.getInputStream());
+        } else if (decompress && "application/x-bzip2".equals(connection.getHeaderField("Content-Type"))) {
+            return FileImporter.getBZip2InputStream(new BufferedInputStream(connection.getInputStream()));
+        } else {
+            return connection.getInputStream();
+        }
     }
 
@@ -664,5 +688,18 @@
      */
     public static BufferedReader openURLReader(URL url) throws IOException {
-        return new BufferedReader(new InputStreamReader(openURL(url), "utf-8"));
+        return openURLReaderAndDecompress(url, false);
+    }
+
+    /**
+     * Opens a connection to the given URL and sets the User-Agent property to JOSM's one.
+     * @param url The url to open
+     * @param decompress whether to wrap steam in a {@link GZIPInputStream} or {@link CBZip2InputStream}
+     *                   if the {@code Content-Type} header is set accordingly.
+     * @return An buffered stream reader for the given URL (using UTF-8)
+     * @throws IOException if an I/O exception occurs.
+     * @since 6421
+     */
+    public static BufferedReader openURLReaderAndDecompress(final URL url, final boolean decompress) throws IOException {
+        return new BufferedReader(new InputStreamReader(openURLAndDecompress(url, decompress), "utf-8"));
     }
 
@@ -670,5 +707,5 @@
      * Opens a HTTP connection to the given URL, sets the User-Agent property to JOSM's one and optionnaly disables Keep-Alive.
      * @param httpURL The HTTP url to open (must use http:// or https://)
-     * @param keepAlive
+     * @param keepAlive whether not to set header {@code Connection=close}
      * @return An open HTTP connection to the given URL
      * @throws IOException if an I/O exception occurs.
Index: /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java
===================================================================
--- /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 6420)
+++ /trunk/test/unit/org/openstreetmap/josm/tools/UtilsTest.java	(revision 6421)
@@ -4,4 +4,9 @@
 import org.junit.Assert;
 import org.junit.Test;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Preferences;
+
+import java.io.BufferedReader;
+import java.net.URL;
 
 /**
@@ -66,3 +71,19 @@
         Assert.assertEquals("fedc", Utils.toHexString(new byte[]{(byte) 0xfe, (byte) 0xdc}));
     }
+
+    @Test
+    public void testOpenUrlGzip() throws Exception {
+        Main.pref = new Preferences();
+        final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http://www.openstreetmap.org/trace/1613906/data"), true);
+        Assert.assertTrue(x.readLine().startsWith("<?xml version="));
+        x.close();
+    }
+
+    @Test
+    public void testOpenUrlBzip() throws Exception {
+        Main.pref = new Preferences();
+        final BufferedReader x = Utils.openURLReaderAndDecompress(new URL("http://www.openstreetmap.org/trace/785544/data"), true);
+        Assert.assertTrue(x.readLine().startsWith("<?xml version="));
+        x.close();
+    }
 }
