UTF « JTextPane « Java Swing Q&A





1. Java JTextPane HTML Editor UTF-8 characters encoding    stackoverflow.com

I'm using JTextPane as simple html editor.

jtp=new JTextPane();
jtp.setContentType("text/html;charset=UTF-8");
jtp.setEditorKit(new HTMLEditorKit());
When I call jtp.getText() I get nice html code with all special chars escaped. But I don't want escape national characters (polish) but ...