I'm getting an html response from a server that I would like to display in a JEditorPane. But the response sets the charset to windows-1252 which seems to cause none of the html to render. (when I comment it out it renders just fine).
So, one solution would be to parse that out before I try to display it, but I was wondering if there's a known bug or anything else I can do to avoid editing the response. Thanks!
In case you want to try it (you'll see it displays if you comment out the 3rd line):
public static void main(String args [])
{
String html = "<!DOCTYPE HTML PUBLIC \"-////W3C////DTD HTML 4.0 Transitional//EN\">" +
"<HTML>" +
"<HEAD>" +
"<META http-equiv=Content-Type content=\"text/html; charset=windows-1252\">" +
"</HEAD>" +
"<BODY>" +
"<P>Hello World</P>" +
"</BODY>" +
"</HTML>";
JEditorPane editor = new JEditorPane("text/html", html);
editor.setEditable(false);
JScrollPane pane = new JScrollPane(editor);
JFrame f = new JFrame("charset=windows-1252");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.getContentPane().add(pane);
f.setSize(800, 600);
f.setVisible(true);
}