Jump to content

Printing Unicode in Java


cout

Recommended Posts

Hey all, I am building a game that uses standard playing cards, and I want to print out the unicode character for the suits.

I am doing this in Java.

Below is some basic test code to see if i could print these characters.

2663 is the unicode value of the character for clubs.

Whenever I run this, all I get is a question mark.

String clubs = "u2663";
System.out.println(clubs);

Thanks for any help.

Link to comment
Share on other sites

Hey all, I am building a game that uses standard playing cards, and I want to print out the unicode character for the suits.

I am doing this in Java.

Below is some basic test code to see if i could print these characters.

2663 is the unicode value of the character for clubs.

Whenever I run this, all I get is a question mark.

String clubs = "u2663";
System.out.println(clubs);

Thanks for any help.

You need a unicode font installed on your system to see them and have the program set to use that unicode font when dispalying the reults.

I had this problem when trying to copy chinese and japanese fonts from web pages that only showed up as square boxes until I installed the font. I could then copy and paste it into other things like googles language tools.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...