Unicode Printing in Java- abstract characters -
i'm making program prints unicode characters. looks this:
public class test { public static void main(string[] args) { system.out.println('\u00a5'); system.out.println((char) 0x00a5); system.out.println((char) (integer.parseint("00a5", 16))); system.out.println('\u261e'); system.out.println((char) 0x261e); system.out.println((char) (integer.parseint("261e", 16))); } }
the output looks like:
¥ ¥ ¥ ? ? ?
why latter half print question marks?
i can understand program printing japanese character, when change \u261e
, can't recognize it. help?
if want apply changes specific project then:
go project properties -> change
text file encoding
utf-8
or
if want apply projects globally then:
got window -> preferences -> general -> workspace : text file encoding
note:
if using other ide, should have similar option there too.
Comments
Post a Comment