Show text in Jtextarea,UTF-8

import java.io.*;
import javax.swing.*;
import java.awt.*;

public class Main {
public static void main(String args[])throws IOException
{
// instantiate data input stream
DataInputStream din = new DataInputStream (System.in);
// Ask user to enter a message
System.out.println("please enter a message:");
// read message from keyboard
FileInputStream in = null;
InputStreamReader inchar=null;
BufferedReader bufferchar=null;

inchar = new InputStreamReader(System.in,"UTF8");
bufferchar= new BufferedReader(inchar);
String msg = bufferchar.readLine();
// print message to screen
System.out.println("you have entered: " + msg);
JFrame frame = new JFrame("Reader test");
JTextArea jta = new JTextArea(msg);
 jta.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(450,200);
jta.setFont(Font.decode("Cp1256"));
frame.add(jta);
frame.setVisible(true);
System.out.println(System.getProperty("file.encoding"));

}
}

This is output:

please enter a message:
من

you have entered: ??
Cp1256

and what I see in Jtextarea is

��

How to solve it?

Do you have that specific font installed on your machine?

public class Main {
public static void main(String args)throws IOException
{
// instantiate data input stream
DataInputStream din = new DataInputStream (System.in);
// Ask user to enter a message
System.out.println(“please enter a message:”);
// read message from keyboard
FileInputStream in = null;
InputStreamReader inchar=null;
BufferedReader bufferchar=null;

inchar = new InputStreamReader(System.in,“UTF8”);
bufferchar= new BufferedReader(inchar);
String msg = bufferchar.readLine();
// print message to screen
System.out.println("you have entered: " + msg);
JFrame frame = new JFrame(“Reader test”);
JTextArea jta = new JTextArea(msg);
jta.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jta.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(450,200);
//jta.setFont(Font.decode(“Cp1256”));

frame.add(jta);
frame.setVisible(true);
System.out.println(System.getProperty(“file.encoding”));

}
}

Now it prints in window
�� ����

I think It is not about the font

import java.io.*;
import javax.swing.*;
import java.awt.*;

public class Main {
public static void main(String args[])throws IOException
{
// instantiate data input stream
DataInputStream din = new DataInputStream (System.in);
// Ask user to enter a message
System.out.println("please enter a message:");
// read message from keyboard
FileInputStream in = null;
InputStreamReader inchar=null;
BufferedReader bufferchar=null;

inchar = new InputStreamReader(System.in,"windows-1256");
bufferchar= new BufferedReader(inchar);
String msg = bufferchar.readLine();
// print message to screen
System.out.println("you have entered: " + msg);
JFrame frame = new JFrame("Reader test");
JTextArea jta = new JTextArea(msg);
jta.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
jta.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(450,200);
//jta.setFont(Font.decode("Cp1256"));
jta.setFont(Font.decode("IranNastaliq-24"));
frame.add(jta);
frame.setVisible(true);
System.out.println(System.getProperty("file.encoding"));

}
}

It works, But I want to know is it possible that put this text in window so it has distance to right side?

May anyone answer my question?

I have another question: How is it possible to create color, size for three line in a Jtextarea so every line has its own color and font?