1

I tried all text file encoding in Eclipse IDE Mars but the Eclipse IDE doesn't display Unicode Playing Cards. I think that Eclipse IDE doesn't support this. Is there anything i can do, so that i will be able to display such?

0x1f0c1 = Ace Diamond

The eclipse IDE console just print nothing.

I wonder the computer specs has to do with this so here is my laptop's specs: Windows 7 32-bit Ultimate

Thank you.

EDIT: I think this has something to do with my laptop. My laptop shows squares only when i look up the link above. Ive tried in other laptop, the wikipedia shows the card not squares.

Community
  • 1
  • 1

1 Answers1

0

Apparently you need to split the unicode into a surrogate pair, at least when using Java. So U+1F0C1 becomes \uD83C\uDCC1.

The Java code:

public static void main(String[] args) {    
    System.out.println("\uD83C\uDCC1");
}

produced for me in the eclipse console using UTF-8 encoding.

References:

Update:

This issue is definitely OS-dependent (or at least font and encoding dependent). The above example works fine on a UTF-8 based Linux platform, but does not render properly for Windows 7 which uses UTF-16 internally. Neither the output from the code example above, nor viewing the Wiki article renders the playing cards properly on Windows 7 with my setup.

Community
  • 1
  • 1
Boo Radley
  • 684
  • 1
  • 13
  • 25