title: Does JEditorPane have Charset problems when showing HTML?
body: <p>I have the following code:</p>
  
  <pre><code>import javax.swing.JEditorPane;
  import javax.swing.JFrame;
  import javax.swing.JScrollPane;
  import javax.swing.ScrollPaneConstants;
  
  
  public class ScratchPad {
  
      public static void main(String args[]) throws Exception {
          String html ="&lt;html&gt;"+
  "&lt;head&gt;"+
  "&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/&gt;"+ // this is the problem right here
  "&lt;title&gt;Error 400 BAD_REQUEST&lt;/title&gt;"+
  "&lt;/head&gt;"+
  "&lt;body&gt;"+
  "&lt;h2&gt;HTTP ERROR: 400&lt;/h2&gt;&lt;pre&gt;BAD_REQUEST&lt;/pre&gt;"+
  "&lt;p&gt;RequestURI=null&lt;/p&gt;"+
  "&lt;p&gt;&lt;i&gt;&lt;small&gt;&lt;a href=\"http://jetty.mortbay.org\"&gt;Powered by jetty://&lt;/a&gt;&lt;/small&gt;&lt;/i&gt;&lt;/p&gt;"+
  "&lt;/body&gt;"+
  "&lt;/html&gt;";
          JFrame f = new JFrame();
          JEditorPane editor = new JEditorPane();
          editor.setEditable( false );
          editor.getDocument().putProperty( "Ignore-Charset", "true" );  // this line makes no difference either way
          editor.setContentType( "text/html" );
          editor.setText( html );
  
          f.add( new JScrollPane(editor, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
                                  ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER) );
          f.pack();
          f.setVisible( true );
      }
  
  }
  </code></pre>
  
  <p>If you run it, you'll notice the frame is blank. However, if I remove the "; charset=ISO-8859-1" from the meta tag, the HTML shows up. Any ideas why and what I can do to prevent this (other than manually hacking the HTML string over which I have no control...).</p>
  
  <p><strong>Edit #1</strong> - putProperty( "Ignore-Charset", "true" ) makes no difference unfortunately.</p>