title: How do you make a *.rtf file to be displayed in an UTF-8 encoding on a JContentPane?
body: <p>I'm struggling to display an Arabic rtf in a JEditorPane. It shows the wrong characters probably because it's the wrong encoding and I have no idea on how to fix it.</p>
  
  <p>Can I get some help? Here's the relevant part of the code.</p>
  
  <pre><code>                textPane.setEditorKit(new AdvancedRTFEditorKit());
                  textPane.setBackground( Color.white );
                  try {
                      BufferedReader fi = new BufferedReader(
                                 new InputStreamReader(
                                            new FileInputStream("C:/test - Copy.rtf"), "UTF-8"));
  
  
  
                      rtf.read( fi, textPane.getDocument(), 0 );
  
  
  
                      System.out.println(textPane.getDocument());
                      System.out.println(rtf.toString());
  
                      } 
                  catch( FileNotFoundException e )
                  {
                  System.out.println( "File not found" );
                  }
                  catch( IOException e )
                  {
                  System.out.println( "I/O error" );
                  }
                  catch( BadLocationException e )
                  {
  </code></pre>
  
  <p>Thank you in advance.</p>