0

What settings are needed so that Java class main method can accept Marathi/Devanagarai/UTF-8 characters. e.g.

    public static void main(String[] args) {
       System.out.println(args[0]);
       System.out.println("भारत");
    }

In eclipse Java run arguments if I specify argument as "abc" it prints

abc
भारत

But If I specify Marathi/Devanagarai/UTF-8 string e.g. "कौशिक" then it prints

?????
भारत 

What extra settings to be done in eclipse ? Later I want to excute this program from jar using command and call it from PHP e.g. java -cp xyz.jar DevanagariTest कौशिक What extra parameters will be needed at that time ?

enter image description here enter image description here

Kaushik Lele
  • 6,439
  • 13
  • 50
  • 76

1 Answers1

0

I think it has something to do with your default system encoding. You can try to start the Java Programm with an additional Argument:

-Dfile.encoding=UTF-8
Benjamin Schüller
  • 2,104
  • 1
  • 17
  • 29