• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

ASCII/Unicode Card reprsentation

 
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to print out the ASCII/unicode representation of hearts, clubs, spades and diamonds

instead of saying with strings...
String suits[] = { "Hearts", "Diamonds", "Clubs", "Spades" };
I tried this

String suits[] = { "\u2665", "\u2666", "\u2663", "\u2660" };

when printing I got a ?

http://www.fileformat.info/info/unicode/char/2660/index.htm

I noticed this...string.toUpperCase()
my unicode is rusty...
 
James Chegwidden
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind I got it...wrong Unicode values
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by James Chegwidden:
Nevermind I got it...wrong Unicode values


What did you use instead?

The key is finding an application that knows how to interpret these values and display the desired symbol. Consoles (even Mac's Terminal) are generally not good at this. Note, however, that putting your original values into a Swing application should work nicely...
 
James Chegwidden
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What did you use instead?



Actually I went back to a swing based unicode and the first set worked. Thanks...
 
reply
    Bookmark Topic Watch Topic
  • New Topic