Reputation: 533
Reduced version of my current problem: I'm trying to print the character π in java, but when I do:
System.out.println("π");
All I get in the console is a question mark. I don't know why this happens and I haven't been able to fix it, hopefully someone will know how to. Thanks
Upvotes: 0
Views: 237
Reputation: 602
Make sure that your source code is writen in UTF-8.
You can also use a UNICODE constant directly, like this:
System.out.println("\u03C0");
Upvotes: 1
Reputation: 25
You could use the escape character \u03C0
. This stackoverflow post is the same question.
Upvotes: 1