I'm tyring to print a String with Arabic characters:
private static void print(String msg, Object... args) {
try {
PrintStream ps = new PrintStream(System.out, true, "ISO-8859-6");
ps.println(String.format(msg, args));
} catch (UnsupportedEncodingException error) {
System.err.println(error);
System.exit(0);
}
}
However, I see from the Eclipse log console that the Arabic characters as displayed as series of these kind of characters èååêÒÉ
What could be missing in my code?
Make sure the console you use to display the output is also encoded in ISO-8859-6. In Eclipse , you need to go to Run Configuration > Common to do this.
try this: