I have a Java program which prints Arabic text to Command prompt in windows. I read the text in three ways,
- From Database
- From file
- From hard coded Arabic String
When I run the code from within the IDE (Intellij Idea) it works well i.e. prints the Arabic but it is not working when I run the program from Command prompt. I also print the character encoding, From IDE, the encoding is UTF-8 and from command prompt it is Cp1252. This is the problem. I also compiled and run the program using this command respectively,
javac -encoding UTF8 Testing.java
java -Dfile.encoding=UTF8 Testing
but this also didn't work. I also set an environment variable JAVA_TOOL_OPTIONS
to -Dfile.encoding="UTF8"
but still not working. Arabic is shown as ?????... Any help would be appreciated. Thanks