0

I'm trying to use Unicode character Θ (\u0398) in my java program, But when I print that character, I'm getting ?.

System.getProperty("file.encoding") is showing value Cp1252 on my machine. I have tried to change this property to UTF8, But I'm still getting ?. The sample code that I use in my test program is given below.

 char[] CHAR_TABLE = { '@', '\u0398', '1', };
 for(int i=0; i< CHAR_TABLE.length; i++) {
    System.out.println(CHAR_TABLE[i]);
 }

The output of this code is:

@
?
1

I was facing the same issue in another Java application (on another machine), but after service restart everything was fine.

Mubeen
  • 43
  • 1
  • 8
  • Does this answer your question? [How to print Unicode symbols U+2610 and U+2612 to Windows console with Java?](https://stackoverflow.com/questions/41480295/how-to-print-unicode-symbols-u2610-and-u2612-to-windows-console-with-java) – phuclv Oct 03 '20 at 05:54
  • I have already tried this one and changed file.encoding at startup. But still no luck – Mubeen Oct 03 '20 at 06:18

0 Answers0