I am trying to work with some arabic text for a web app, however I cannot get my program to output arabic text as per example below:
which generates the following output
Some SOME_ENGLISH_TEXT:some english text
Some SOME_ARABIC_TEXT:??? ??? ???
Basically, when I try to write Arabic text to System.out I get question marks as output.
It is strange because when I enter text through a web form, and then through a middle layer write it to a MySql database, or write it to a webpage like
The problem is not your program, it's the console. The console uses a font that doesn't contain glyphs for Arabian characters.
What you could do is make a custom output window in Swing (with a simple JTextArea component) and set the font to something like MS Gothic, and redirect System.out to your custom output window using a PipedWriter/PipedOutputStream. Alternatively, you can output to a textfile and open it in an editor using a font like MS Gothic.
I rarely work with IDEs, maybe you can set the font of your IDEs output window? That should be a fairly simple trick.