Index: trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 5145)
+++ trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java	(revision 5146)
@@ -441,5 +441,5 @@
                         User user = p.getUser();
                         if (user != null)
-                            return "<html>" + XmlWriter.encode(user.getName()) + " <font color=gray>(" + user.getId() + ")</font></html>";
+                            return "<html>" + XmlWriter.encode(user.getName(), true) + " <font color=gray>(" + user.getId() + ")</font></html>";
                     }
                     return null;
Index: trunk/src/org/openstreetmap/josm/io/XmlWriter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/io/XmlWriter.java	(revision 5145)
+++ trunk/src/org/openstreetmap/josm/io/XmlWriter.java	(revision 5146)
@@ -22,12 +22,25 @@
     }
 
+    public static String encode(String unencoded) {
+        return encode(unencoded, false);
+    }
+
     /**
      * Encode the given string in XML1.0 format.
      * Optimized to fast pass strings that don't need encoding (normal case).
+     *
+     * @param unencoded the unencoded input string
+     * @param keepApos true if apostrophe sign should stay as it is (in order to work around
+     * a Java bug that renders
+     *     new JLabel("<html>&apos;</html>")
+     * literally as 6 character string, see #7558)
      */
-    public static String encode(String unencoded) {
+    public static String encode(String unencoded, boolean keepApos) {
         StringBuilder buffer = null;
         for (int i = 0; i < unencoded.length(); ++i) {
-            String encS = XmlWriter.encoding.get(unencoded.charAt(i));
+            String encS = null;
+            if (!keepApos || unencoded.charAt(i) != '\'') {
+                encS = XmlWriter.encoding.get(unencoded.charAt(i));
+            }
             if (encS != null) {
                 if (buffer == null) {
